Turn any Linux into a router with two Brook commands

Updated at: 2023-03-19


Generated by Text to Image


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

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 > /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 --start --gateway --dnsserver