Skip to content

Instantly share code, notes, and snippets.

@AzimsTech
Last active November 19, 2025 20:12
Show Gist options
  • Select an option

  • Save AzimsTech/fee582c7c5a89e9295e78f4c8bbda824 to your computer and use it in GitHub Desktop.

Select an option

Save AzimsTech/fee582c7c5a89e9295e78f4c8bbda824 to your computer and use it in GitHub Desktop.
OpenWrt Wireless Network Bridge (With IPv6 Support)

OpenWrt Wireless Network Bridge (With IPv6 Support)

diag0 drawio6

Goals

  • To use OpenWrt Router as a wifi adapter instead of a regular wireless card for a stronger & stable Wifi connection.
  • Use existing proprietary AP provided by ISP (Doesn't support Mesh or WDS)

Configuration Files

/etc/config/network
...

config interface 'lan' # LAN interface name
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.1.1' # Assign an IP address in a different subnet
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wwan' # Wireless LAN interface name
	option proto 'static' 
	option ipaddr '192.168.0.124' # New static IP same subnet as main router
	option netmask '255.255.255.0'
	option gateway '192.168.0.1' # LAN IP of main router
	list dns '192.168.0.1'  # LAN IP of main router
	option device 'wlan0' # wlan0 refers to 5Ghz radio (change this accordingly)

config interface 'wwan6' # Wireless LAN interface name for IPv6 support
	option proto 'dhcpv6' # Use DHCPv6 for IPv6 
	option device '@wwan' # Aliases of Wireless LAN interface
	option reqaddress 'none' 
	option reqprefix 'auto'

config interface 'relay_bridge' # Assign any name
	option proto 'relay' 
	option ipaddr '192.168.0.124' # Same static IP as wwan
	list network 'lan' # lan interface
	list network 'wwan' # wwan inteface
/etc/config/wireless
config wifi-device 'radio0' # This is for 5Ghz radio
	option type 'mac80211'
	option path 'pci0000:00/0000:00:00.0'
	option band '5g'
	option htmode 'VHT80' # Wifi channel width
	option channel 'auto' 
	option country 'MY' # Wifi country code
	option cell_density '0'

config wifi-device 'radio1' # This is for 2.4Ghz radio
	option type 'mac80211'
	option path 'platform/ahb/18100000.wmac'
	option channel 'auto'
	option country 'MY' # Wifi country code
	option band '2g'
	option htmode 'HT20' 
	option disabled '1' # Disable 2.4Ghz if you use 5Ghz

config wifi-iface 'wifinet2'
	option device 'radio0' # Use 5Ghz radio
	option mode 'sta'
	option network 'wwan' # Assign to Wireless LAN interface
	option ssid 'My Wifi Hotspot' # Wifi Name
	option encryption 'psk2' # Wifi encryption modes 
	option key '********' # Wifi Password
/etc/config/firewall
...

config zone
	option name 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'lan' # lan inteface
	list network 'wwan' # wwan inteface
	list network 'wwan6' # wwan6 inteface
	list network 'relay_bridge' # relay bridge inteface
/etc/config/dhcp
...

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option ignore '1' # Disable DHCP for this interface
	option ra 'relay' # For IPv6 relay
	option ndp 'relay' # For IPv6 relay

config dhcp 'wwan6'
	option interface 'wwan6'
	option ignore '1' # Disable DHCP for this interface
	option master '1'
	option ra 'relay' # For IPv6 relay
	option ndp 'relay' # For IPv6 relay

Research

@AzimsTech
Copy link
Copy Markdown
Author

AzimsTech commented Dec 19, 2022

diag0 drawio6

@vibrolax
Copy link
Copy Markdown

Thank you for showing me how to configure my old TP-Link WDR3600 as a transparent wireless bridge with ipv6! I've been wanting to do this for years, but I never had the patience to figure out ipv6.
The only thing I had to change was the "option device 'wlan0'" for interface wwan. Around version 22.03, OpenWRT changed the naming convention for devices, and the device is now called 'phy1-sta0' (radio1 is my 5GHz radio.

@AzimsTech
Copy link
Copy Markdown
Author

@vibrolax Hi, I’m glad this helped. Though this was old writing from when I first started using OpenWrt. Now that I have two OpenWrt routers, I use WDS instead of relayd, which is more stable and has lower ping.

relayd still works if you're in a pinch. 😉

@vibrolax
Copy link
Copy Markdown

My main router is supplied by my ISP, and doesn't support WDS (I tried). I use the WDR3600 as a utility wireless bridge, so the reduced performance of relayd is acceptable, but keeps everything on the same subnet for convenience, and the ipv6 mdns services just work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment