Brook Transparent Proxy Gateway on Windows

https://www.txthinking.com
Created at: 06 Apr 2022
Updated at: 06 Apr 2022
cloud@txthinking.com

Brook

https://github.com/txthinking/brook

Windows version

Only Windows 10 Pro or Enterprise, version 1803 (“April 2018 Update”) or later

Install multipass

Version >= 1.9.0

  1. Download .exe file, https://github.com/canonical/multipass/releases
  2. Install. I forgot if I need to restart computer
  3. Run. An icon will appear in the system tray. Just run it, no need to manipulate it. Let's continue to use the CMD with the system to operate

Set bridged network

Get network list

multipass networks

Output like this

Name                   Type      Description
Default Switch         switch    Virtual Switch with internal networking
WLAN                   wifi      Broadcom 802.11ac Network Adapter
以太网                 ethernet  Broadcom NetXtreme Gigabit Ethernet

Choose the Ethernet name,here is 以太网, Of course your windows needs to be connected to the network cable, the wireless network card may not work well

Set bridged network

Open a CMD terminal as administrator

multipass set local.bridged-network="以太网"

Close the CMD terminal opened as an administrator, continue to use the CMD terminal of ordinary users

Launch an instance

Set name mybrook

multipass launch --name mybrook --bridged

Download brook_linux_amd64 file and joker_linux_amd64 file

https://github.com/txthinking/brook/releases/latest/download/brook_linux_amd64

https://github.com/txthinking/joker/releases/latest/download/joker_linux_amd64

Copy brook_linux_amd64 and joker_linux_amd64 to mybrook : /tmp/

multipass transfer brook_linux_amd64 mybrook:/tmp/brook
multipass transfer joker_linux_amd64 mybrook:/tmp/joker

Enter mybrook

multipass shell mybrook

let's go

Change to root

sudo su

copy joker and brook command

mv /tmp/joker /usr/bin/joker
chmod +x /usr/bin/joker
mv /tmp/brook /usr/bin/brook
chmod +x /usr/bin/brook

Stop systemd-resolved occupying port 53

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

Start brook tproxy, more parameters and rules --help

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

Check if the startup is successful

joker list

If not running, take a look at the error log

joker log `joker last`

exit root user

exit

exit mybrook

exit

Get gateway IP

multipass info mybrook

The IP on the same network segment as your host is the gateway created

Set the gateway and DNS of other devices to this IP.