Updated at: 2025-02-19
New version:Run brook on OpenWrt One
To assemble OpenWrt yourself, you can use an old computer. Generally, you need 2 or more network ports, preferably with a wireless network card.
Download the 23.05.2
version 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.gz
First, 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
lsblk
Write to the hard drive with root user
gunzip -c openwrt.img.gz | dd of=/dev/sda bs=4M
Shutdown, disconnect the Ethernet cable, remove the USB drive, and boot.
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
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.
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.
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 http3.ooo -t A -s 192.168.2.1:53
brook dnsclient -d http3.ooo -t AAAA -s 192.168.2.1:53
brook dnsclient -d http3.ooo -t A -s [xxx]:53
brook dnsclient -d http3.ooo -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
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
Download brook CLI and rename to
brook
and copy to OpenWrt
brook dnsclient -d http3.ooo -t A -s 127.0.0.1:53
brook dnsclient -d http3.ooo -t AAAA -s 127.0.0.1:53
brook dnsclient -d http3.ooo -t A -s [::1]:53
brook dnsclient -d http3.ooo -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://...'
opkg update
opkg install ca-bundle kmod-nf-socket kmod-nft-socket kmod-nf-tproxy kmod-nft-tproxy procps-ng-ps
Download brook.openwrt CLI and rename to
brook.openwrt
and copy to OpenWrt
brook.openwrt --link 'brook://...'
Check the two DNS servers allocated on your computer; one should be IPv4 and the other IPv6
brook dnsclient -d http3.ooo -t A -s 192.168.2.1:53
brook dnsclient -d http3.ooo -t AAAA -s 192.168.2.1:53
brook dnsclient -d http3.ooo -t A -s [xxx]:53
brook dnsclient -d http3.ooo -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