Trang này chưa được dịch sang tiếng Việt; nội dung được hiển thị bằng ngôn ngữ khác.
What to do when your server's IP is blocked
In China, the most common form of "the server is broken" is this: the VPS itself is fine, only its IP has been blocked. bx then says it "can't reach
bx status, a menu notification, the tunnel line of bx doctor), while protection keeps blocking traffic as before — nothing leaks.
There is only one way out: give the server a new IP. How much work follows depends on whether your link contains an IP or a domain name.
The link contains a domain name: changing one DNS record is enough
- Change the VPS's IP at your provider (some call it "change IP"; others require releasing it and allocating a new one).
- Change the domain's A record to the new IP.
- Nothing else is needed. bx on Mac, Linux, and Windows re-resolves the server's domain name after the tunnel has been down for a full two minutes and follows it to the new address (at most a few more minutes of waiting, depending on the DNS record's TTL); the iPhone re-resolves on every reconnect.
So if you have a domain name, use it when installing the server:
- In the Mac menu's "I Need a Server…", enter the domain name directly in the address field (first point the domain's A record at this VPS);
- or run
sudo bx server up --host <your-domain>on the server; - to switch an already-installed server to a domain name: run
sudo bx server link --host <your-domain>on the server, then add the new link once on each device (Mac menu "Add an Existing Server…", scanning the code on the iPhone,bx server add '<new-link>'on Linux/Windows; the keys are unchanged, so bx recognizes it as the same server and replaces the old entry instead of adding another server).
When using a domain name, it is advisable to have the DNS record resolve directly (on Cloudflare, turn off the proxy — the grey cloud), and not put a CDN in front: bx's tunnel is not web traffic.
The link contains an IP: each device needs the link replaced once
-
Change the VPS's IP at your provider.
-
Log in to the server and move the link to the new IP (the keys are unchanged):
sudo bx server link --host <new-IP>It moves the hysteria2 link on the same machine, and every link handed out with
bx user invite, to the new address too. If you are not sure what the new IP is, first runsudo bx server link: the server will tell you directly when its IP differs from the one in the link. -
Add the printed new link to every device: Mac menu, Servers window, "Add an Existing Server…"; scanning the code on the iPhone;
bx server add '<new-link>'on Linux/Windows. Since the keys have not changed, bx recognizes it as the same server, replaces the old address, and switches over on the spot (the same holds for a device configured with only one server — no extra server appears).
This step has to be done once on every device — which is exactly why a domain name is recommended.
Ways to be less affected
- Keep two servers in your list (ideally with different providers, in different data centers). When one is blocked, the other is most likely still reachable;
after you turn on "Switch servers automatically" (
bx server auto-switch on, or in the menu's Servers window), bx switches over by itself. Note that switching servers changes your egress IP; bx explains the consequences before you turn it on. - If the devices are for family and friends: bring them into your fleet (Using bx with family and friends); after that, an IP change is done only once on your own computer, and their devices follow automatically.
- Choose a provider that makes changing IPs easy: the kind billed by the hour that lets you release IPs, so when one is blocked you can get a new one within minutes.