I currently run OpenWrt 24.10.0 with two WAN interfaces.
root@wrt:~# ubus call system board
{
"kernel": "6.6.73",
"hostname": "wrt",
"system": "ARMv7 Processor rev 1 (v7l)",
"model": "Linksys WRT1200AC",
"board_name": "linksys,wrt1200ac",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "24.10.0",
"revision": "r28427-6df0e3d02a",
"target": "mvebu/cortexa9",
"description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
"builddate": "1738624177"
}
}
It's a simple setup with a default route metric configured for the second (backup) interface:
network.wan=interface
network.wan.device='wan.7'
network.wan.proto='pppoe'
network.wan.ipv6='1'
network.wwan=interface
network.wwan.proto='dhcp'
network.wwan.device='eth1'
network.wwan.metric='128'
So wwan
should never be used unless wan
doesn't have a default route.
This works fine for IPv4, however IPv6 is a different story:
network.wan6=interface
network.wan6.device='@wan'
network.wan6.proto='dhcpv6'
network.wan6.reqaddress='try'
network.wan6.reqprefix='auto'
network.wan6.norelease='1'
network.wan6.metric='512'
network.wwan6=interface
network.wwan6.device='eth1'
network.wwan6.proto='dhcpv6'
network.wwan6.reqaddress='try'
network.wwan6.reqprefix='auto'
network.wwan6.norelease='1'
network.wwan6.metric='4096'
The metric
is completely ignored unless I hack /lib/netifd/dhcpv6.script
:
setup_interface () {
[...]
for entry in $RA_ROUTES; do
local duplicate=$NOSOURCEFILTER
local addr="${entry%%/*}"
entry="${entry#*/}"
local mask="${entry%%,*}"
entry="${entry#*,}"
local gw="${entry%%,*}"
entry="${entry#*,}"
local valid="${entry%%,*}"
entry="${entry#*,}"
#local metric="${entry%%,*}"
[...]
There is still source routing of course. So that only works when disabling source routing and doing NAT66. If I don't filter prefixes on lan
clients tend to chose their own prefix instead of going with preferred one.
What's the best practice to apply here?