Turn Linux into a Gateway with Brook
Updated at: 2024-01-01
Requirements
- A Linux 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 Linux, normally start Brook in TUN mode (The GUI defaults to TUN mode)
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.ipv4.ip_forward=1
Test
Try on other device:
- Then set the gateway of the other devices to the IP of this Linux
- 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 Linux gateway device 137.184.237.95/32.
Try on other device again:
curl http3.ooo -v