I have a working dual stack OpenWrt router (let's call it the main router) connected to my ISP, and I also run a OpenWrt VM for experiments that uses bridged network, so it appears as a sub-router in my LAN.
Everything works except IPv6. My LAN machines and the sub-router can successfully access the Internet via IPv6, but not machines behind the sub-router. In those machines, when pinging an IPv6 address, it would fail with Network is unreachable
.
The issue seems to stem from the sub-router's routing table, which contains entries like
default from <main router ULA/64> via <main router LAN link-local ip> ...
default from <main router public IPv6 subnet/64> via <main router LAN link-local ip> ...
The machines behind the sub-routers don't get assigned any public IPv6, only link-local IPs and the sub-router's ULA, so I guess the packets from them do not fall in the range specified by the from
clause, thus unreachable network?
There seems to be two possible fixes:
- Make the sub-router use the main router as the default gateway without any of the
from
clause.
I wonder if it's the main router or the sub-router that should be configured? What UCI options should I use? - Make the machines behind the sub-router also have public IPv6.
I have no idea why that's not currently the case. Would appreciate some enlightening.
The main router's /etc/config/network
config interface 'lan'
option proto 'static'
option device 'br-lan'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth1'
option proto 'pppoe'
option username '...'
option password '...'
option ipv6 'auto'
The main router's /etc/config/dhcp
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option ra_default '1'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
The sub-router's /etc/config/network
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.10.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
The sub-router's /etc/config/dhcp
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option ra 'server'
option ra_default '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option dhcpv6 'server'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
Thanks in advance.