Brook Shiliew Cheap Zhi Meeting Nan mitmproxy client Network Activity Monitor iOS Old App Downloader SSH Terminal Subtitle 菜根谭 Socks5 Configurator IPvBar File Link Markdown Editor IP AI nami joker brook ipio nico z zoro hancock mad httpserver google hosts

Turn macOS into a Gateway with Brook

Updated at: 2024-01-01

Requirements

  • A macOS using wired network, since the wireless network card performance will be poor
  • Prevent machine from hibernating or sleeping
  • Although Brook supports IPV6, but many downstream devices are unable to set up IPv6 gateway and DNS, so it is necessary to disable IPv6 on downstream or upstream devices.

Run Brook

On this macOS, normally start Brook in TUN mode (which is the default).

Note that you should disable FakeDNS(The GUI defaults to having FakeDNS enabled). Because other devices do not have the route to the Fake IP, they can't communicate back, of course, you can tweak things yourself, but the I think this is a bit cumbersome and unnecessary.

Enabling Forwarding

sudo sysctl -w net.inet.ip.forwarding=1

Test

Try on other device:

  • Then set the gateway of the other devices to the IP of this macOS
  • Then set the DNS of the other devices to 8.8.8.8
curl http3.ooo -v

Traffic Splitting

Try bypassing the IP of http3.ooo with Brook on the macOS gateway device 137.184.237.95/32.

Try on other device again:

curl http3.ooo -v

Discuss

© TxThinking, Inc. All Rights Reserved.