[SOLVED] No IPv6 default route in main routing table

Hi,

I have 2 IPv6 upstream interfaces

config interface 'wan6'
	option proto 'dhcpv6'
	option device '@wan'
	option reqaddress 'try'
	option sourcefilter '0'
	option reqprefix 'auto'
	option metric '10'
	option delegate '0'

config interface 'wan6_cable'
	option proto 'dhcpv6'
	option device 'lan1'
	option reqaddress 'try'
	option metric '20'
	option sourcefilter '0'
	option reqprefix 'auto'
	option delegate '0'

Both have defaultroute set to 1

The strange thing is somehow the defaultroute for wan6_cable is not set in the main routing table, only in table 4 unlike the pppoe-wan and IPv4 Cable Interface (lan1):

root@OpenWrt:~# ip route show table all|grep default
default via 195.xx.xx.108 dev pppoe-wan table 1 proto static metric 10 
default via 176.xx.xx.1 dev lan1 table 3 proto static src 176.xx.xx.121 metric 20 
default via 195.xx.xx.108 dev pppoe-wan proto static metric 10 
default via 176.xx.xx.1 dev lan1 proto static src 176.xx.xx.121 metric 20 
default via fe80::xxxx:xxxx:xxxx:cfe1 dev pppoe-wan table 2 proto static metric 512 pref medium
default via fe80::xxxx:xxxx:xxxx:b846 dev lan1 table 4 proto static metric 512 pref medium
default via fe80::xxxx:xxxx:xxxx:cfe1 dev pppoe-wan proto static metric 512 pref medium

That leads to mwan3 marking the interface as offline, I can manually add the default route into the main table and mwan3 works, but can someone maybe tell me the proper way to configure this?

Thanks :slight_smile:

EDIT: I forgot to mention I also had to add a /128 route for the gateway to be able to ping it

You'll need to provide more details and all relevant configs for us to better assist you.

Can you show us this information?

e.g.

  • I don't see a "wan6_cable" interface
  • I don't see configs for the static routes you mentioned
  • I don't see Table 4 enumerated in any config

Can you show this setting?

Sorry, I should have known better working in tech support facepalm

Sorry I tried to "anonymize" my config bcs. I am a bit paranoid, but I guess it's fine I corrected it.

Maybe I should have mentioned, that I installed mwan3 for failover, I wasn't aware that it does configure additional routing tables, otherwise I do not have any extra routing tables configured

So here is my mwan3 config:

config globals 'globals'
	option mmx_mask '0x3F00'

config interface 'wan'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv4'
	list track_ip <omitted>
	option track_method 'ping'
	option reliability '2'
	option count '1'
	option size '56'
	option max_ttl '60'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config interface 'wan6'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv6'
	list track_ip <omitted>
	option track_method 'ping'
	option reliability '2'
	option count '1'
	option size '56'
	option max_ttl '60'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config interface 'wan_cable'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv4'
	list track_ip <omitted>
	option track_method 'ping'
	option reliability '1'
	option count '1'
	option size '56'
	option max_ttl '60'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config interface 'wan6_cable'
	option enabled '1'
	option initial_state 'online'
	option family 'ipv6'
	list track_ip <omitted>
	option track_method 'ping'
	option reliability '1'
	option count '1'
	option size '56'
	option max_ttl '60'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config member 'wan_m1_w2'
	option interface 'wan'
	option metric '1'
	option weight '2'

config member 'wan6_m1_w2'
	option interface 'wan6'
	option metric '1'
	option weight '2'

config member 'wan_cable_m2_w1'
	option interface 'wan_cable'
	option metric '2'
	option weight '1'

config member 'wan6_cable_m2_w1'
	option interface 'wan6_cable'
	option metric '2'
	option weight '1'

config policy 'failover'
	list use_member 'wan_m1_w2'
	list use_member 'wan6_m1_w2'
	list use_member 'wan_cable_m2_w1'
	list use_member 'wan6_cable_m2_w1'
	option last_resort 'unreachable'

config rule 'default'
	option proto 'all'
	option sticky '0'
	option use_policy 'failover'

I do not have a config for static routes, instead they are dynamically added by a script in odhcp6c.user.d:

DHCPC_EVENT="${2}"
DHCPC_IF="${INTERFACE}"
DHCPC_GW="${SERVER}"
case ${DHCPC_EVENT} in
(bound|updated|ra-updated) ;;
(*) exit 0 ;;
esac
case ${DHCPC_IF} in
(wan6_cable) ;;      
(*) exit 0 ;;   
esac
ifstatus_dhcp_if=$(ifstatus $DHCPC_IF)
ip -6 route add $(echo $ifstatus_dhcp_if|jsonfilter -e '@["route"][0].nexthop') dev $(echo $ifstatus_dhcp_if|jsonfilter -e '@.l3_device') metric 1024
ip -6 route add default via $(echo $ifstatus_dhcp_if|jsonfilter -e '@["route"][0].nexthop') dev $(echo $ifstatus_dhcp_if|jsonfilter -e '@.l3_device') metric 1024 
EOF

Essentially this looks up the nexthop for wan6_cable, adds it as a route for it and sets the default gateway via the nexthop:

fe80::xxxx:xxxx:xxxx:b846 dev lan1 metric 1024 pref medium
default via fe80::xxxx:xxxx:xxxx:b846 dev lan1 metric 1024 pref medium

If I don't do this mwan3 marks this interface as offline

I do not have defaultroute in my config as the default value is 1

We kinda went in a circle - what default value?
I assume you mean the IPv6 interfaces, correct?
(We never clarified what configs you're referring to.)

It seems you've significantly edited your first post, so that it now includes a wan6_cable interface, and now you mentioned mwan3.

Since I manually configure my device and don't use apps like mwan3 - perhaps another user can assist.

Yea, perhaps others can decipher it. My understanding was you had a DHCPv6 interface. It's not clear if this is some workaround or if there's another reason for this script.

I hope the best for your setup. Feel free to add more details.

Thank you for taking the time to answer.

I meant with this the global default value of defaultroute is 1 ( https://openwrt.org/docs/guide-user/network/ipv6/configuration ) thats why you don't see it in the config, I could add "option defaultroute '1'" to both (IPv6) interfaces, but it would be redunant, If I understand correctly, the default route should added to the routing table if not explicitely disabled.

Yep I meant the IPv6 Interfaces, sorry.

Yeah I tried to anonymize my config, because I paniced about posting my config on a public forum, but it's nonsense and I see it's a hindrance for you or others helping me so I apologize for that. Now it reflects the actual config

Sorry no need to decipher it, just ignore it: It only adds the two lines (right after the script in my last post) to the routing table so mwan3 detects the interface as up and uses it. My issue is that it (mwan3) doesn't work without the script (e.g. without the 2 extra lines in the routing table - only wan, wan6 and wan_cable works if I delete it and start fresh).

EDIT: I get the route Information from ifstatus wan6_cable there is an entry named nexthop, which I cannot ping in the first place if I don't add it (fe80::xxxx:xxxx:xxxx:b846 dev lan1 metric 1024 pref medium) to the routing table, so there seems to be an issue to reach the gateway in the first place, maybe that is why no default route is added? For wan6 the next-hop route is set automatically.

Yep 2 DHCPv6 one wan6 as an alias Interface of @wan (L2-Interface: pppoe-wan) for which the the default route is correctly set seemingly (in the main routing table)

The second one wan6_cable directly on L2-Interface lan1 for which seemingly the default route is not set in the main table.

Maybe also my terminus is wrong, with main table I mean that there is no table X set in the line (see ip route show in the first post)

I see thank you for the time and effort you put into resolving the issue

Okay I am really dumb I thought I needed sourcefilter '0' for some reason, but this actually caused the problem.

If it is activated only the default route of the Interface last activated is set and the other is deleted. When sourcefilter set to 1 or removed the default routes get set correctly and actally contain the correct source prefix so lesson learned

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.