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.
Running bx on an OpenWrt router (router mode)
Install bx on the router and every device behind it — phones, TVs, consoles, devices you cannot install software on — goes out through your own server, with nothing installed on the devices. The router's own traffic goes through the tunnel too; Tailscale keeps going direct.
So far this has been verified on real hardware only on the GL.iNet Mudi 7 (GL-E5800). Other OpenWrt routers that meet the requirements below should work, but nobody has verified them — for the first install, make sure you can plug in a cable and reach the router's admin interface.
Check the router first
| Requirement | Details |
|---|---|
| System | OpenWrt 22.03 or later (needs fw4 / nftables). Vendor firmware such as GL.iNet works as long as it is built on such an OpenWrt |
| CPU architecture | Run uname -m on the router. aarch64 (arm64) and x86_64 are fully supported; armv7l (armv7) and mips (little-endian mipsel only — the install script checks) are experimental: tested only in an emulator (QEMU), not on real hardware, and they do not bundle brook (it is downloaded from upstream when a brook link is used) |
| Storage | About 90 MB on arm64 / x86-64, about 35 MB on armv7 / mipsel (check with df -h /overlay) |
| Memory | 512 MB or more recommended on arm64 / x86-64, at least 256 MB on armv7 / mipsel: at run time bx unpacks its bundled tunnel programs (about 70 MB on arm64, about 40 MB on armv7 / mipsel) into /var/lib/bx, which is a RAM disk on OpenWrt |
| TUN | /dev/net/tun must exist. If it does not, install kmod-tun first (opkg update && opkg install kmod-tun; newer OpenWrt uses apk add kmod-tun) |
| Server | A VPS with bx server already installed, and the link it printed (see Server) |
ISP-supplied routers and stock TP-Link / Huawei / Xiaomi firmware are not OpenWrt and cannot run it; x86 soft routers, GL.iNet devices and routers flashed with OpenWrt can. Older routers with 16 / 32 MB of flash or 128 MB of RAM do not have room for it.
Install
Log in to the router over SSH as root (OpenWrt has no sudo; run everything as root):
wget -qO- https://dl.getbx.net/install.sh | sh
bx setup --router '<the link the server printed>'
bx up
install.shverifies the SHA256, installs bx to/usr/local/bin/bx, and puts a link at/usr/bin/bx.bx setup --routerruns a connectivity check, writes/etc/bx/config.yaml(withmode: router) and installs the procd service, without starting it. The LAN networks are detected from thebr-*private bridges by default; to name them, add--lan 192.168.8.0/24(repeatable). If the server printed two links, put the flags before them:bx setup --router --udp '<udp link>' '<main link>'.bx upturns protection on, and the whole LAN starts going through bx.
Verify
bx status
Status should be Protected and Tunnel should show a latency. Then, on a device on the LAN, open any
"what is my IP" page: it should show the VPS's address. On a computer you can also run bx leakcheck for a
full leak test.
On, off, and the kill switch
bx downturns protection off: the LAN goes back to direct.bx upturns it on again.- While protection is on, the LAN can leave only through bx. In the tens of seconds after a reboot before
bx is up, and whenever bx is stopped or has crashed, the LAN does not go out directly (only private ranges,
addresses in
bypassand bx's own servers are reachable). The cost: if bx cannot start (the server is down, the link is no longer valid), the whole LAN has no internet until you fix it or runbx down. This is deliberate — better offline than leaking the real IP. - LAN IPv6 forwarding is always dropped (IPv6 would bypass the tunnel and expose the real address); devices fall back to IPv4 on their own.
Limitations to know
- After changing the server list, restart protection once (
bx down && bx up): in router mode the server bypass and accept rules are the ones from when bx started. - DNS: LAN devices' lookups are forwarded by the router's dnsmasq. When its upstream is a public DNS server the lookups go through bx; if the upstream is a private address (an upstream router at 192.168.1.1, say), the lookups go to that machine directly, not through the tunnel — to tunnel DNS as well, point dnsmasq at a public DNS server.
- Tailscale on the router keeps working; its own traffic goes direct, not through the tunnel.
- Router firmware varies a lot; after installing, check the exit as described under "Verify".
Updating and uninstalling
- Update:
bx update(on Linux bx checks once a day by default, installs a new version only after it has been the latest for a day, and rolls back on its own if the new one fails to start). - Uninstall:
bx uninstallstops the service and removes every route and firewall rule bx installed (including the kill switch); the LAN goes back to direct. The configuration stays in/etc/bx/; to remove everything, also runrm -rf /etc/bx /usr/local/bin/bx /usr/bin/bx.