Brook OpenWRT: Perfectly supports IPv4/IPv6/TCP/UDP

Updated at: 2024-02-07



Write the system to the OpenWRT hard drive

  1. 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
  2. First, create an Ubuntu bootable USB drive, insert the OpenWRT device and boot from the USB drive

  3. 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 ./
  4. Check the router's hard drive

  5. Write to the hard drive with root user

    gunzip -c openwrt.img.gz | dd of=/dev/sda bs=4M
  6. Shutdown, disconnect the Ethernet cable, remove the USB drive, and boot.

Change the router's address

uci set network.lan.ipaddr=
uci commit

Remove serial console

vim /boot/grub/grub.cfg

Remove this, otherwise, the startup will be slow


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 If the router has multiple ports, try each one until you find the one that grants access.

Remove ULA

  1. Network - Interfaces - Global network options - IPv6 ULA-Prefix - Save & Apply

Configure WAN

  1. 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.
  2. Network - Interfaces - wan - Edit - General Settings - Protocol: PPPoE - Switch protocol - username/password - Save - Save & Apply
  3. 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

  1. Network - Interfaces - lan - Edit - Advanced Settings - IPv6 assignment length: 64
  2. Network - Interfaces - lan - Edit - Advanced Settings - DHCP Server - IPv6 RA Settings - RA Flags: None - Save - Save & Apply

Test 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 -t A -s
brook dnsclient -d -t AAAA -s
brook dnsclient -d -t A -s [xxx]:53
brook dnsclient -d -t AAAA -s [xxx]:53
brook echoclient -s
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777

Expand root

opkg update
opkg install parted losetup resize2fs
wget -U "" -O ""
. ./


Test on OpenWrt

brook dnsclient -d -t A -s
brook dnsclient -d -t AAAA -s
brook dnsclient -d -t A -s [::1]:53
brook dnsclient -d -t AAAA -s [::1]:53
brook echoclient -s
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777

Test your Brook Server

brook testbrook --link 'brook://...'

Install Brook.ipk

Brook.ipk will use :9999,, [::1]:8888,

  1. System - Software - Update lists...
  2. System - Software - Upload Package... - Brook.ipk

Then open dashboard

Test on computer

Check the two DNS servers allocated on your computer; one should be IPv4 and the other IPv6

brook dnsclient -d -t A -s
brook dnsclient -d -t AAAA -s
brook dnsclient -d -t A -s [xxx]:53
brook dnsclient -d -t AAAA -s [xxx]:53

Test IPv4 and IPv6, as well as TCP and UDP, of course, your Brook Server should support dual-stack

brook echoclient -s
brook echoclient -s [2604:a880:4:1d0::4cf:b000]:7777