π₯ Check out this insightful post from Hacker News π
π Category:
β Main takeaway:
This article is currently an experimental machine translation and may contain errors. If anything is unclear, please refer to the original Chinese version. I am continuously working to improve the translation.
Introduction
This blog post should be the final part of the βRunning Your Own ISP at Homeβ series, and weβre going to talk about how to modify the geolocation of the IP addresses we announce.
By tweaking IP geolocation, you can:
- Display absurd IP locations on various platforms β for example, Antarctica (which barely has internet infrastructure), North Korea (which isnβt connected to the global internet), or some obscure tiny country with only tens of thousands of people
- Use a single VPS to obtain IP addresses from all over the world,
show off on probe networksand achieve a weird kind of βAll In Oneβ status (yep, even this is All In One now) - Unlock region-locked streaming services β see this hostloc thread
Run a one-man IDC selling VPSes from all corners of the globeβ I found one called GlobalVM, but havenβt tried it, so no recommendation. Feel free to search on your own.
This article will mainly focus on modifying IP geolocation and using WARP to get a corresponding-region IPv4 address. Unlocking streaming content and running an IDC wonβt be covered in depth β refer to the link above if interested.
Prerequisites
This is probably common knowledge for many, but for completeness, letβs go over it briefly.
IP Databases
IP database providers compile mappings from IP β geographical location using methods like network scanning and WHOIS lookups. They also include data such as IP threat scores and type (residential, server, or VPN). These databases are sold to users β typically websites β which then query them in the backend to display location info and perform risk assessment. A handy tool for querying multiple geolocation databases at once: https://iplark.com/
Popular IP databases include Maxmind, IPInfo, and DB-IP. Smaller databases often sync data from larger ones.
WARP
WARP is a WireGuard-based VPN service provided by Cloudflare. While they offer an official Linux client, most people use native WireGuard to connect. WARP can provide your server with both IPv4 and IPv6 addresses, commonly used to add IPv4 connectivity to IPv6-only VPSes (or vice versa). One key feature of WARP is that the public IP it assigns will have the same geolocation as the IP youβre connecting from β weβll use this property later. For a detailed WARP setup guide, check out: https://p3terx.com/archives/use-cloudflare-warp-to-add-extra-ipv4-or-ipv6-network-support-to-vps-servers-for-free.html
Submitting Geolocation Correction Requests
In reality, the βlocationβ of an IP is inherently fuzzy. For instance, my 2a14:7c0:4d00::/40 block was originally allocated to Israel. But later, I bought parts of this range and announced them via BGP in Germany, the US, and Singapore (see previous article on Anycast networks). Meanwhile, Iβm physically located in mainland China. As the owner of this IP block, I can also freely edit the country field in the WHOIS database β and I set it to KP (North Korea).
Because of this ambiguity, itβs nearly impossible to precisely determine an IPβs location using any single technical method. As a result, almost all geolocation databases accept public/user-submitted correction requests.
Preparation
Before submitting any requests, letβs do a little prep work.
IP databases collect IP ranges from global routing tables. Previously, we were announcing the entire 2a14:7c0:4d00::/40 block without subdividing it in RIPE NCC, which makes it harder for databases to process smaller segments. So letβs fix that.
Log in to the RIPE Database, go to My Resources β IPv6 β Create assignment, and fill out the form to create a new inet6num (which represents an IPv6 address block):
inet6num: Enter a subnet. The smallest allowed is/48, so I entered2a14:7c0:4d00::/48. If you only own a/48, you canβt subdivide further β you can only edit the LIR-assigned block.netname: Pick a name you likecountry: Choose the country/region you want this IP block to appear inadmin-c&tech-c: Fill in two contact objects β use the ones you created earlierstatus: SelectASSIGNEDto indicate itβs assigned
Form for creating a new inet6num
After creation, you can see all your subnets under βMy Resourcesβ:
Viewing subnets under the LIR-assigned block
Next, update the BIRD configuration from our previous article, changing 2a14:7c0:4d00::/40 to 2a14:7c0:4d00::/48, then restart BIRD.
After some time, use BGP Tools to verify that 2a14:7c0:4d00::/48 is now visible. The old /40 page should return 404.
Submitting Correction Requests
You can submit geolocation correction requests to common IP databases: Maxmind, IPInfo, Google
If asked for justification, write something like βDue to incorrect IP geolocation, I/my clients cannot access region-restricted websitesβ (in English). Avoid mentioning use for anonymous proxies β that might violate their correction policies.
Each database has its own review process. Some involve manual checks, and changes usually take 3 days to 2 weeks to go live. Most offer online lookup tools (like Maxmindβs Demo) β you can use them to check progress, or use IPLark for batch queries.
In my test, IPInfo accepted my request within a week. Maxmind didnβt respond after two weeks, so I followed up via their contact form, and they finally approved it. (Wait a bit first β only reach out after multiple failed submissions.)
(p.s. Recently, Maxmind has been rejecting requests to set location to Antarctica (AQ) β probably too many people trying to go there. Thatβs why this article uses North Korea as an example. If you really want an Antarctica IP, try the geofeed method at the end to bypass manual review.)
Below is for reference only β feel free to make up craft your own justification:
Q: Hello, I am the network operator and owner of AS214775. I found out that my IP address segment 2a14:7c0:4d00::/40 is incorrectly localized to Israel, causing me to be denied access to other websites. I have tried several times to submit data corrections using the data correction form, but no response. I have corrected the country of my IP segment in the RIPE NCC database, and some other databases such as ipinfo.io have been synchronized, but Maxmind keeps locating my IP segment to Israel. I would like to politely ask why MaxMind has not responded to my correction request?
A: Thank you for your email. This will be updated in Tuesdayβs release of the database.
Using WARP to Get a Region-Matched IPv4
Cloudflare uses Maxmindβs database, so as long as Maxmind reflects your desired location, WARP will follow suit. Note that Cloudflare may lag behind Maxmind by 1β2 weeks. If Maxmind shows the correct location but Cloudflare hasnβt updated, just wait a little longer.
WARP assigns IPv4 (and IPv6) addresses based on your connection IPβs geolocation. The IPv4 address not only allows access to IPv4-only sites, but its geolocation is maintained by Cloudflare β highly accurate and consistent across databases, much more reliable than manually submitting corrections everywhere.
Weβve already introduced WARP, so letβs jump straight into setup using this guide:
1 |
|
Now test your VPSβs IPv4 geolocation using Cloudflareβs /cdn-cgi/trace endpoint (available on any site behind CF). ip=104.28.212.208 means we got that IP, colo=DUS means weβre connecting via the DUS (DΓΌsseldorf Airport) data center (IATA code), loc=IL means geolocation is IL (Israel) (country code), and warp=on confirms WARP is active:
We did successfully change our location, but loc=IL means Cloudflare hasnβt picked up Maxmindβs update yet β letβs wait a bit longer
1 |
root@s39230 ~ |
After nearly ten real-world days, Cloudflare WARP finally updated its database! Even slower than Cloudflareβs other servicesβ¦ At this point, it had been about two weeks since Maxmind updated, and a full month since my first correction request β almost missed the deadline before my server expired (thankfully, it didnβt).
Retest, and now we see the new IP 104.28.197.243 returns loc=KP, and Bilibiliβs API shows North Korea:
1 |
root@s39230 ~ |
Letβs check our own IPv6 and WARP-assigned IPv4 using IPLark:
Our IPv6 is only recognized as North Korea by Maxmind β others think itβs Antarctica or Germany β all over the place (but 80% of sites rely on Maxmind anyway)
WARP-assigned IPv4 is consistently shown as North Korea
Now just set up a proxy on this VPS, and you can proudly flaunt your North Korean IP across the web. (If youβve read this far, I assume you know how to set up a proxy.)
Final proof: a real Bilibili comment screenshot π€£
Optional: Geofeed and Preventing Reversion
Lastly, the promised βLight Up the Globeβ trick. For large providers with IPs all over the world, manually submitting corrections isnβt practical.
Thatβs where Geofeed comes in β a standard allowing bulk geolocation submissions: https://docs.ipdata.co/docs/publishing-a-geofeed. Besides submitting your Geofeed via support ticket to Maxmind, you can also embed the Geofeed URL in the inet6num object in WHOIS, allowing databases to automatically crawl and update your IP locations. With this, you can get IPs from all sorts of bizarre countries, show off on probe dashboards and achieve βLight Up the Globeβ status.
IP geolocation isnβt set-and-forget β databases may re-scan and revert your location. To reduce this risk, block ICMP (ping) and common ports via firewall to avoid scanning. Also, avoid using your serverβs native IPv6 to browse the web β stick to WARP-assigned IPv4. Some providers (cough Google cough) may even use client-side (mobile) location to correct server IP geolocation. See this article for details.
Conclusion
Finallyβ¦ This series began planning in June 2024, went through countless hurdles and waiting periods, and now wraps up just before December. If I waited any longer, my ASN and server wouldβve expired (quietly).
Weβve explored setting up and maintaining an autonomous system on the Internet, configured BGP, peers, Anycast, and now IP geolocation spoofing β satisfying some bizarre curiosities, and gaining a new appreciation for ISPs and one-man IDCs (or not).
I might try DN42 next, or maybe not. For now, this series ends here. See you in the next blog post~ o/
π¬ What do you think?
#οΈβ£ #Running #ISP #Home #Part.5
π Posted on 1763089501
