bx
فارسی — زبان

این صفحه هنوز به فارسی ترجمه نشده است؛ نسخه‌ای به زبان دیگر در زیر نمایش داده می‌شود.

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 from this network" (the Tunnel line of 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.

  1. Change the VPS's IP at your provider (some call it "change IP"; others require releasing it and allocating a new one).
  2. Change the domain's A record to the new IP.
  3. 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:

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.

  1. Change the VPS's IP at your provider.

  2. 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 run sudo bx server link: the server will tell you directly when its IP differs from the one in the link.

  3. 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