Running Your Own ISP at Home Part.5

This article is currently an experimental machine translation and may contain errors. If something is unclear please refer to the original Chinese version. I am constantly working to improve the translation.

Introduction

This blog post should be the last part of “Running your own ISP at home” series, and we are going to talk about how to modify the geolocation of the IP address that we declare.

By changing IP geolocation, you can:

  • Display absurd IP locations on different platforms – for example, Antarctica (which barely has Internet infrastructure), North Korea (which is not connected to the global Internet), or some obscure small country with only tens of thousands of people
  • Use a single VPS to get IP addresses from around the world, Show off on Probe Network And get a weird kind of “all in one” situation (yes, now it’s all in one too)
  • Unlock region-locked streaming services – see this Hostlock thread
  • Run a one-person IDC selling VPS from all corners of the world – I found one called GlobalVM, but I haven’t tried it, so no recommendations. Feel free to explore yourself.

This article will mainly focus on using WARP to modify IP geolocation and obtain the IPv4 address of the corresponding region. Unlocking streaming content and running IDC will not be covered in depth – check out the link above if interested.

Prerequisites

This is probably common knowledge to many people, but for the sake of completeness, let’s look at it briefly.

IP Database

IP database provider compile mapping IP → geographical location Using methods such as network scanning and WHOIS lookups. They also include data such as IP threat score and type (residential, server, or VPN). These databases are sold to users – usually websites – who then query them in the backend to display location information and perform risk assessments. A useful 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 databases.

Taunt

WARP is a WireGuard-based VPN service provided by Cloudflare. Although they offer an official Linux client, most people use the native WireGuard to connect. WARP can provide both IPv4 and IPv6 addresses to your server, which is commonly used to add IPv4 connectivity to IPv6-only VPSes (or vice versa). A key feature of WARP is The public IP it assigns will have the same geolocation as the IP you are connecting from – We will use this property later. For a detailed WARP setup guide, see: https://p3terx.com/archives/use-cloudflare-warp-to-add-extra-ipv4-or-ipv6-network-support-to-vps-servers-for-free.html

Submitting a geolocation correction request

In fact, the “location” of an IP is inherently ambiguous. For example, my 2a14:7c0:4d00::/40 The block was originally allocated to Israel. But later, I bought parts of this range and announced them via BGP in Germany, USA and Singapore (see previous article on anycast networks). Meanwhile, I am physically located in mainland China. As the owner of this IP block, I can also edit it freely country field in the WHOIS database – and I set it to KP (North Korea).

Because of this ambiguity, it is almost impossible to accurately determine the location of an IP using any one technical method. As a result, almost all geolocation databases accept public/user submitted correction requests.

Preparation

Before submitting a request, let’s do a little preparation.

IP databases collect IP ranges from global routing tables. Earlier we were making full announcement 2a14:7c0:4d00::/40 Block it without subdividing it in RIPE NCC, making it harder for the database to process smaller segments. So let’s fix this.

Log in to the RIPE database, go to My Resources → IPv6 → Create assignmentAnd fill the form to create a new one inet6num (which represents the IPv6 address block):

  • inet6num: Enter a subnet. is the smallest allowed /48so i entered 2a14:7c0:4d00::/48If you only have one /48You cannot subdivide further – you can only edit LIR-assigned blocks.
  • netname: Choose the name you like
  • country:Select the country/region you want to show this IP block in
  • admin-c , tech-c: Fill in two contact objects – use the ones you created earlier.
  • status: choose ASSIGNED To indicate that it has been assigned

Form for creating a new inet6numForm for creating a new inet6num

After creation, you can see all your subnets under “My Resources”:

Viewing Subnets within a LIR-Assigned BlockViewing Subnets within a LIR-Assigned Block

Next, update from our previous article Changing the BIRD Configuration 2a14:7c0:4d00::/40 To 2a14:7c0:4d00::/48Then restart BIRD.

After some time, use BGP tools to verify it 2a14:7c0:4d00::/48 Now visible. Old /40 The page should return 404.

Submitting a correction request

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 customers cannot access region-restricted websites” (in English). Avoid mentioning use of anonymous proxies – that may violate their moderation policies.

Each database has its own review process. Some involve manual checking, and it usually takes 3 days to 2 weeks for changes to go live. Most provide online lookup tools (like MaxMind’s demo) – you can use them to check progress, or use IPLock for batch queries.

In my testing, IPInfo accepted my request within a week. Maxmind still didn’t respond after two weeks, so I contacted them through their contact form and they eventually approved it. (Wait a bit first – get in touch only after multiple unsuccessful submissions.)

(PS Recently, MaxMind has been rejecting requests to set the location for Antarctica (AQ) – there are probably a lot of people trying to get thereThat’s why this article uses North Korea as an example, If you really want Antarctica IP, try the geofeed method at the end to bypass manual review,)

Below is for reference only – feel free to to complete Create your own justification:

Question: Hello, I am the network operator and owner of AS214775. I discovered 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 correction using the data correction form, but have not received any 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 finding my IP segment in Israel. I would like to politely ask why Maxmind did not respond to my improvement request?

Answer: Thank you for your email. This will be updated in the database released on Tuesday.

Using WARP to get region-matched IPv4

Cloudflare uses MaxMind’s database, so as long as MaxMind shows the location you want, WARP will follow it. Note that Cloudflare may lag 1-2 weeks behind Maxmind. If MaxMind shows the correct location but Cloudflare hasn’t updated, just wait for a while.

WARP assigns IPv4 (and IPv6) addresses based on the geolocation of your connection IP. Not only does the IPv4 address allow access to IPv4-only sites, but its geolocation is maintained by Cloudflare – highly accurate and consistent across the database, far more reliable than manually submitting corrections everywhere.

We’ve already introduced WARP, so let’s jump straight into setup using this guide:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

curl -fsSL git.io/wgcf.sh | sudo bash
wgcf register
wgcf generate

vim wgcf-profile.conf










ip -6 route add /128 via dev eth0 src 's_IPv6_address>
# Example: ip -6 route add 2606:4700:d0::a29f:c001/128 via 2a03:d9c0:2000::5 dev eth0 src 2a14:7c0:4d00::1

cp wgcf-profile.conf /etc/wireguard/warp.conf
wg-quick up warp

Now test your VPS’s IPv4 geolocation using Cloudflare /cdn-cgi/trace Endpoint (available at any site behind CF). ip=104.28.212.208 This means that we have found that IP, colo=DUS This means that we are connecting through the DUS (Dusseldorf Airport) data center (IATA code), loc=IL This means that the geolocation is IL (Israel) (country code), and warp=on Confirms that WARP is active:

We successfully changed our location, but loc=IL This means that Cloudflare has not yet picked up the update for MaxMind – let’s wait a little longer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
root@s39230 ~ 
fl=910f1
h=www.cloudflare.com
ip=104.28.212.208
ts=1731586511.237
visit_scheme=https
uag=curl/7.88.1
colo=DUS
sliver=none
http=http/2
loc=IL
tls=TLSv1.3
sni=plaintext
warp=on
gateway=off
rbi=off
kex=X25519


root@s39230 ~
{"code":0,"msg":"","message":"","data":{"addr":"104.28.212.210","country":"Israel","province":"Jerusalem District","city":"Jerusalem","isp":"cloudflare.com","latitude":"31.768319","longitude":"35.21371"}}

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 almost two weeks since I updated MaxMind, and a full month since my first repair request – almost as long as my server had expired before it expired (thankfully, it didn’t).

Test again, and now we see the new IP 104.28.197.243 Return loc=KPAnd Bilibili’s API North Korea shows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
root@s39230 ~ 
fl=48f122
h=www.cloudflare.com
ip=104.28.197.243
ts=1732203935.881
visit_scheme=https
uag=curl/7.88.1
colo=DUS
sliver=none
http=http/2
loc=KP
tls=TLSv1.3
sni=plaintext
warp=on
gateway=off
rbi=off
kex=X25519

root@s39230 ~
{"code":0,"msg":"","message":"","data":{"addr":"104.28.197.248","country":"North Korea","province":"Pyongyang","city":"","isp":"cloudflare.com","latitude":"39.073798","longitude":"125.819764"}}

Let’s check our own IPv6 and WARP-assigned IPv4 using IPLarch:

Our IPv6 is recognized by Maxmind only as far as North Korea - others think it's Antarctica or Germany - everywhere else (but 80% of sites rely on Maxmind anyway)Our IPv6 is recognized by Maxmind only as far as North Korea – others think it’s Antarctica or Germany – everywhere else (but 80% of sites rely on Maxmind anyway)

IPv4 assigned by WARP is constantly shown as North KoreaIPv4 assigned by WARP is constantly shown as North Korea

Now simply set up a proxy on this VPS, and you can proudly display your North Korean IP on 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 🤣Final Proof: A Real Bilibili Comment Screenshot 🤣

Alternative: Geofeed and Preventing Reversion

Finally, the promised “Light Up the Globe” trick. For large providers with IPs around the world, submitting corrections manually is not practical.

it is right here geofeed Comes – a standard that allows bulk geolocation submission: https://docs.ipdata.co/docs/publishing-a-geofeed. In addition to submitting your geofeed to MaxMind via a support ticket, you can also embed a geofeed URL in inet6num The object in WHOIS allows the database to automatically crawl and update your IP locations. With it, you can get IPs from all kinds of strange countries, Show test dashboard And achieve the status of “Light up the Globe”.

IP geolocation is not set-and-forget – databases can re-scan and return your location. To reduce this risk, block ICMP (ping) and normal ports through the firewall to avoid scanning. Also, avoid using your server’s native IPv6 to browse the web – use WARP-specified IPv4 only. Some providers (cough Google cough) may also use client-side (mobile) location to correct server IP geolocation. See this article for details.

conclusion

Finally… planning for this series began in June 2024, went through countless hurdles and waiting periods, and is now coming to an end just before December. If I had waited any longer, my ASN and server would have expired (silently).

We have figured out the installation and maintenance of 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 may try DN42 next time, or maybe not. For now this series ends here. See you in the next blog post~o/



Leave a Comment