Brook OpenWRT: Perfectly supports IPv4/IPv6/TCP/UDP
Updated at: 2025-02-19
New version:Run brook on OpenWrt One

Prepare OpenWrt device
To assemble OpenWrt yourself, you can use an old computer. Generally, you need 2 or more network ports, preferably with a wireless network card.
Write the system to the OpenWRT hard drive
Download the
23.05.2version of OpenWRT on your computer according to the specifics of your device, for instance, I am using macOS.Different versions of OpenWRT may vary greatly; it's recommended to use the version that I am using.
curl -o openwrt.img.gz https://downloads.openwrt.org/releases/23.05.2/targets/x86/64/openwrt-23.05.2-x86-64-generic-ext4-combined-efi.img.gzFirst, create an Ubuntu bootable USB drive, insert the OpenWRT device and boot from the USB drive
Connect the computer and the router with an Ethernet cable, and change their IPs to the same subnet. Then copy the openwrt.img.gz file from the computer to the router
scp xxx@xxx:/path/to/openwrt.img.gz ./Check the router's hard drive
lsblkWrite to the hard drive with root user
gunzip -c openwrt.img.gz | dd of=/dev/sda bs=4MShutdown, disconnect the Ethernet cable, remove the USB drive, and boot.
Change the router's address
uci set network.lan.ipaddr=192.168.2.1
uci commit
If there is, remove serial console
vim /boot/grub/grub.cfg
Remove this, otherwise, the startup will be slow
console=ttyS0,115200n8
Reboot or Power off then boot
Connect the computer with an Ethernet cable
Change the IP of the computer to the same subnet as the router, then visit http://192.168.2.1. If the router has multiple ports, try each one until you find the one that grants access.
Remove ULA
- Network - Interfaces - Global network options - IPv6 ULA-Prefix - Save & Apply
Configure WAN
- Connect the modem to another port on the router. If you're not sure which port it is, try them one by one and check the router's management page to see if there is data flow on the WAN.
- Network - Interfaces - wan - Edit - General Settings - Protocol: PPPoE - Switch protocol - username/password - Save - Save & Apply
- If a wan_6 has been automatically created at this point, delete the previous wan6. Save & Apply
If you haven't obtained IPv6 PD here, and if your modem also has routing capabilities, then it needs to support issuing PD. Otherwise, allow OpenWRT to dial in to obtain PD. If not, please contact your ISP and say no to all non-Native solutions like Relay, NAT6, etc.
Configure LAN
- Network - Interfaces - lan - Edit - Advanced Settings - IPv6 assignment length: 64
- Network - Interfaces - lan - Edit - Advanced Settings - DHCP Server - IPv6 RA Settings - RA Flags: None - Save - Save & Apply
Test on computer
Install brook CLI on computer
Unplug and re-plug the computer's network cable at this time to automatically acquire an IP, which should be a GUA, and the DNS should also be a GUA. If a ULA is still obtained at this point, it should disappear after the next router reboot
brook dnsclient -d txthinking.com -t A -s 192.168.2.1:53
brook dnsclient -d txthinking.com -t AAAA -s 192.168.2.1:53
brook dnsclient -d txthinking.com -t A -s [xxx]:53
brook dnsclient -d txthinking.com -t AAAA -s [xxx]:53
xxx is your computer IPv6 GUA DNS which get from OpenWrt
brook echoclient -s 137.184.237.95:7777
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777
Expand root
opkg update
opkg install parted losetup resize2fs
wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh
Reboot
Test on OpenWrt
Download brook CLI and rename to
brookand copy to OpenWrt
brook dnsclient -d txthinking.com -t A -s 127.0.0.1:53
brook dnsclient -d txthinking.com -t AAAA -s 127.0.0.1:53
brook dnsclient -d txthinking.com -t A -s [::1]:53
brook dnsclient -d txthinking.com -t AAAA -s [::1]:53
brook echoclient -s 137.184.237.95:7777
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777
Test your Brook Server
brook testbrook --link 'brook://...'
Install Dependencies
opkg update
opkg install ca-bundle kmod-nf-socket kmod-nft-socket kmod-nf-tproxy kmod-nft-tproxy procps-ng-ps
Install brook.openwrt
Download brook.openwrt CLI and rename to
brook.openwrtand copy to OpenWrt
brook.openwrt --link 'brook://...'
Test on computer
Check the two DNS servers allocated on your computer; one should be IPv4 and the other IPv6
brook dnsclient -d txthinking.com -t A -s 192.168.2.1:53
brook dnsclient -d txthinking.com -t AAAA -s 192.168.2.1:53
brook dnsclient -d txthinking.com -t A -s [xxx]:53
brook dnsclient -d txthinking.com -t AAAA -s [xxx]:53
xxx is your computer IPv6 GUA DNS which get from OpenWrt
Test IPv4 and IPv6, as well as TCP and UDP, of course, your Brook Server should support dual-stack
brook echoclient -s 137.184.237.95:7777
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777