Turn any Linux into a router with two Brook commands

https://www.txthinking.com/talks/
Updated at: 2023-03-19
cloud@txthinking.com

x

Generated by Text to Image

Requires

A Linux using wired network, such as Ubuntu, it is recommended to configure a static IP first, such as 192.168.1.10

In theory, a virtual machine would work too. The macOS or Windows using wired network is the host machine, and a virtual machine Ubuntu is installed in it, but the performance may not be good.

Disable systemd-resolved which uses port 53

systemctl stop systemd-resolved
systemctl disable systemd-resolved
echo nameserver 8.8.8.8 > /etc/resolv.conf

Turn Linux into a gateway

brook tproxy --link 'brook://...' --dnsListen :53

Then configure the DNS and gateway of other machines to the IP of this Linux

Turn Linux into a DHCP Server

😡 Turn off other DHCP services in the LAN, such as turning off the DHCP of your hardware router

brook dhcpserver --serverip 192.168.1.10 --start 192.168.1.100 --gateway 192.168.1.10 --dnsserver 192.168.1.10