I'm trying to configure a default IPv6 route at boot in /etc/config/network to fix IPv6 routing in vpn-policy-routing package issues. I have multiple routing tables and so the default guide on @stangri FAQ doesn't work for me.
Here's what I tried:
config route6
option interface 'vpsgw'
option table 'vpsgw'
option target '::/0'
The command that will fix IPv6 for me:
ip -6 route add default dev vpsgw table vpsgw
At router boot that condition doesn't exist so I must have a syntax error perhaps "'::/0' ?
# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdc3:ef08:ee27::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.100.1'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
option reqaddress 'force'
option reqprefix 'no'
option defaultroute '1'
config interface 'vpn_privacy'
option device 'eth0.666'
option netmask '255.255.255.0'
option ipaddr '172.66.6.1'
option proto 'static'
config interface 'wglan'
option device 'eth0.100'
option netmask '255.255.255.0'
option ipaddr '172.100.0.1'
option ip6assign '64'
option proto 'static'
config interface 'isolated'
option device 'eth0.500'
option netmask '255.255.254.0'
option ipaddr '192.168.32.1'
option ip6assign '64'
option iphint 'AA'
list ip6class 'local'
option proto 'static'
config rule 'vpn_privacy_routing4'
option priority '30000'
option lookup '30'
option in 'vpn_privacy'
config rule 'wglan_routing4'
option priority '30000'
option lookup '20'
option in 'wglan'
config rule6 'wglan_routing6'
option priority '30000'
option lookup '20'
option in 'wglan'
config interface 'sharktun'
option device 'tun0'
option ip4table '30'
option ip6table '30'
option proto 'none'
config interface 'vpsgw'
option mtu '1350'
option ip4table '20'
option ip6table '20'
config wireguard_vpsgw 'wgserver'
config route
option interface 'lan'
option table '20'
option netmask '255.255.255.0'
option target '192.168.100.0/24'
option gateway '192.168.100.1'
config route
option interface 'wan'
option table '20'
option netmask '255.255.255.0'
option target '192.168.12.0/24'
config route
option interface 'isolated'
option table '20'
option netmask '255.255.254.0'
option target '192.168.32.0/23'
option gateway '192.168.32.1'
config route6
option interface 'vpsgw'
option table 'vpsgw'
option target '::/0'
These are the routing tables at boot with current configuration (missing the default route on table vpsgw):
# route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flags Metric Ref Use Iface
fd25:8911:3113:9525::10/128 :: U 1024 1 0 vpsgw
::/0 :: U 1024 1 0 vpsgw
::/0 :: !n -1 3 0 lo
::/0 fe80::de8d:8aff:fe47:b1dd UG 512 1 0 eth1
::/0 fe80::de8d:8aff:fe47:b1dd UG 512 1 0 eth1
2607:fb90:4021:8890::/64 :: U 256 1 0 eth1
2607:fb90:4021:8890::/64 fe80::de8d:8aff:fe47:b1dd UG 512 1 0 eth1
fe80::/64 :: U 256 1 0 eth1
::/0 :: !n -1 3 0 lo
fe80::/64 :: U 256 1 0 tun0
::/0 :: !n -1 3 0 lo
::/0 :: !n -1 3 0 lo
::/0 fe80::de8d:8aff:fe47:b1dd UG 512 2 0 eth1
::/0 fe80::de8d:8aff:fe47:b1dd UG 512 1 0 eth1
2607:fb90:4021:8890::/64 :: U 256 3 0 eth1
2607:fb90:4021:8890::/64 fe80::de8d:8aff:fe47:b1dd UG 512 1 0 eth1
2607:fb90:4021:8890::/64 :: !n 2147483647 1 0 lo
fdc3:ef08:ee27::/64 :: U 1024 5 0 br-lan
fdc3:ef08:ee27:10::/64 :: U 1024 4 0 eth0.500
fdc3:ef08:ee27:11::/64 :: U 1024 1 0 eth0.100
fdc3:ef08:ee27::/48 :: !n 2147483647 2 0 lo
fe80::/64 :: U 256 1 0 eth0.500
fe80::/64 :: U 256 1 0 eth0.666
fe80::/64 :: U 256 2 0 eth1
fe80::/64 :: U 256 1 0 eth0.100
fe80::/64 :: U 256 1 0 br-lan
fe80::/64 :: U 256 1 0 tun0
::/0 fe80::de8d:8aff:fe47:b1dd UGDA 1024 3 0 eth1
::1/128 :: Un 0 7 0 lo
2607:fb90:4021:8890::/128 :: Un 0 3 0 eth1
2607:fb90:4021:8890:8cc7:baff:fea6:1f0/128 :: Un 0 3 0 eth1
2607:fb90:4021:8890:b5b4:4941:0:cbd/128 :: Un 0 5 0 eth1
fd25:8911:3113:9525::10/128 :: Un 0 2 0 vpsgw
fdc3:ef08:ee27::/128 :: Un 0 3 0 br-lan
fdc3:ef08:ee27::1/128 :: Un 0 4 0 br-lan
fdc3:ef08:ee27:10::/128 :: Un 0 3 0 eth0.500
fdc3:ef08:ee27:10::1/128 :: Un 0 7 0 eth0.500
fdc3:ef08:ee27:11::/128 :: Un 0 3 0 eth0.100
fdc3:ef08:ee27:11::1/128 :: Un 0 3 0 eth0.100
fe80::/128 :: Un 0 4 0 eth1
fe80::/128 :: Un 0 3 0 eth0.666
fe80::/128 :: Un 0 3 0 eth0.100
fe80::/128 :: Un 0 3 0 eth0.500
fe80::/128 :: Un 0 3 0 br-lan
fe80::/128 :: Un 0 3 0 tun0
fe80::1e13:46a:2e64:cc6/128 :: Un 0 2 0 tun0
fe80::8cc7:baff:fea6:1f0/128 :: Un 0 5 0 eth1
fe80::d434:f4ff:fea2:4c4c/128 :: Un 0 2 0 eth0.666
fe80::d434:f4ff:fea2:4c4c/128 :: Un 0 2 0 eth0.100
fe80::d434:f4ff:fea2:4c4c/128 :: Un 0 3 0 eth0.500
fe80::d434:f4ff:fea2:4c4c/128 :: Un 0 2 0 br-lan
ff00::/8 :: U 256 6 0 br-lan
ff00::/8 :: U 256 4 0 eth0.500
ff00::/8 :: U 256 1 0 eth0.666
ff00::/8 :: U 256 3 0 eth1
ff00::/8 :: U 256 4 0 eth0.100
ff00::/8 :: U 256 1 0 vpsgw
ff00::/8 :: U 256 1 0 tun0
::/0 :: !n -1 3 0 lo
root@meow:~#