bx
Bahasa Indonesia — Bahasa

Halaman ini belum diterjemahkan ke bahasa Indonesia; ditampilkan dalam bahasa lain.

Configuration

Named egress (hand certain subnets to an existing tunnel)

First, when not to use it: if you can use Tailscale, use Tailscale — just enable a subnet router on the internal machine (or the VPS), and bx does not get in its way (private addresses are not bound to the physical interface and follow the system routing table; the /16 a subnet router advertises is also more specific than bx's /8). That route is configured once, benefits every device, and needs not a single line changed in bx.

Use this only when a mesh is not an option (the internal network cannot reach out):

Commands (no need to edit YAML by hand):

bx egress add office 127.0.0.1:1080     # opened by ssh -D 1080 -J <vps> <internal-host>
bx egress route office 10.84.0.0/16     # allowlist: only the subnets listed go through it
bx egress ls
bx egress rm office                     # also removes the subnets assigned to it

In the config file it looks like this:

egress:
  - name: office
    socks5: 127.0.0.1:1080

rules:
  - via: office
    cidr: ['10.84.0.0/16']

A few fixed semantics:

Default client config path:

/etc/bx/config.yaml

Default server config path:

/etc/bx/server.yaml

You usually do not need to write a config by hand. bx server install and bx setup generate the required files automatically.

Common client settings (below is an explanation of the keys, not the file bx setup writes — it writes only server (or transports), global: true, killswitch: true, plus owner_uid under sudo and the udp.transport given by --udp; it writes no other key, relying on config.Parse to fill in defaults):

server: "bx://..."
killswitch: true
global: true                  # setup writes true here; change it to false to use the china split
dns:
  china: 223.5.5.5
  fakeip_cidr: 198.18.0.0/15
  # Hand internal domain names to the internal DNS for resolution, and force them direct. On
  # Windows you usually do not need to write this yourself: bx automatically hands this machine's
  # internal DNS suffixes (AD domain, the adapter's connection-specific suffix, the DNS suffix
  # search list pushed by Group Policy/the system) to the internal DNS on the adapter (otherwise
  # the domain controller cannot be found, internal services do not open, and domain account
  # logins fail)
  split:
    - domains: ["*.corp.example"]
      servers: ["10.0.0.23", "10.0.0.24"]
bypass:
  - 10.0.0.0/16
hosts:                        # pin a domain to a fixed IPv4 (while bx is on, /etc/hosts has no effect on apps)
  nas.home.example: 192.168.1.20
rules:
  - direct: ["*.corp.internal", "10.0.0.0/8"]
  - proxy: ["*.openai.com"]

Notes:

Router mode (mode: router)

Install bx on a gateway/router and it proxies the LAN clients' forwarded traffic and the router's own traffic (the catch-all policy rule does not match on source address). bx's own outbound traffic, the bx servers and bypass, Tailscale's 100.64/10 and private ranges stay direct; tailscaled's own rules sit ahead of bx's, so its traffic also goes direct.

mode: router
killswitch: true
router:
  lan_cidrs: [192.168.8.0/24]   # LAN subnets to proxy; leave empty to auto-detect br-* private bridges