I have a setup with multiple wireguard interfaces. Interfaces have both IPv4 and IPv6 addresses and participate in OSPF and OSPFv3 routing.
It appears if no link cost is specified for the interface it receives a value of 100. When I try to override OSPFv3 link cost I'm able to do so with some trickery (delete ospfv3 configuration from the interface -> commit -> re-add ospfv3 configuration -> commit) but then it gets reset to default after ospf6d restarts.
Here is the configuration (wg34 interface is the main focus here):
r3# show interfaces wireguard | strip-private wireguard wg32 { address xxxx:xxxx:6000:fff9::b/64 address xxx.xxx.128.33/32 description tun-r2-r3 ip { ospf { bandwidth 1000 network point-to-point } } ipv6 { ospfv3 { cost 10 } } mtu 1412 peer to-R2 { allowed-ips ::/0 allowed-ips xxx.xxx.0.0/0 pubkey K9vFSAFVXJRxXq3Kgzr133K/10ita/G/LHB4BeYKgzI= } port 49424 private-key default } wireguard wg34 { address xxx.xxx.128.33/32 address xxxx:xxxx:6000:fffb::a/127 description "[r3-r4-tun0] to mtl296" ip { ospf { authentication { md5 { key-id 1 { md5-key xxxxxx } } } bandwidth 1000 network point-to-point } } ipv6 { ospfv3 { cost 10 network point-to-point } } peer to-R4 { address xxxx:xxxx:1:c000::2510 /* allow all adresses to also include multicast */ allowed-ips ::/0 allowed-ips xxx.xxx.0.0/0 port 51820 pubkey YQhOgwVvywUkHPhff2S1fH8DZNMczaY2Z4GNIWgznTw= } port 51820 private-key default } wireguard wg36 { address xxx.xxx.128.33/32 address xxxx:xxxx:6000:bb00::1/128 description "[r3-r6-tun0] to chi1" ip { ospf { authentication { md5 { key-id 1 { md5-key xxxxxx } } } bandwidth 1000 network point-to-point } } ipv6 { ospfv3 { cost 10 } } mtu 1420 peer to-R6 { address xxxx:xxxx:2700:7::2 /* allow all addresses to also include multicast */ allowed-ips ::/0 allowed-ips xxx.xxx.0.0/0 port 53704 pubkey Hf/epxHXqEySB62XMyWqVqAhMyaqhYioXtIKKuKCs3Q= } port 54643 private-key default } ... r3# show protocols ospfv3 | strip-private area 0 { interface dum0 interface tun31 interface wg34 interface eth1 interface wg32 interface wg36 } parameters { router-id xxx.xxx.128.33 } redistribute { static { route-map ALLOW-DEFAULT-ROUTE-IPV6 } }
And this is what interface cost actually is
r3# run show ipv6 ospfv3 interface wg34 wg34 is up, type POINTOPOINT Interface ID: 10 Internet Address: inet : 23.153.128.33/32 inet6: 2620:18:6000:fffb::a/127 inet6: fe80::f42f:9eff:fee4:56be/64 Instance ID 0, Interface MTU 1420 (autodetect: 1420) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 100 State PointToPoint, Transmit Delay 1 sec, Priority 1 Timer intervals configured: Hello 10, Dead 40, Retransmit 5 DR: 0.0.0.0 BDR: 0.0.0.0 Number of I/F scoped LSAs is 2 0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off] 0 Pending LSAs for LSAck in Time 00:00:00 [thread off] r3# run show ipv6 ospfv3 interface wg32 wg32 is up, type POINTOPOINT Interface ID: 11 Internet Address: inet6: 2620:18:6000:fff9::b/64 inet : 23.153.128.33/32 inet6: fe80::f171:d2ff:fe97:5f53/64 Instance ID 0, Interface MTU 1412 (autodetect: 1412) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 100 State PointToPoint, Transmit Delay 1 sec, Priority 1 Timer intervals configured: Hello 10, Dead 40, Retransmit 5 DR: 0.0.0.0 BDR: 0.0.0.0 Number of I/F scoped LSAs is 2 0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off] 0 Pending LSAs for LSAck in Time 00:00:00 [thread off] r3# run show ipv6 ospfv3 interface wg36 wg36 is up, type POINTOPOINT Interface ID: 9 Internet Address: inet : 23.153.128.33/32 inet6: 2620:18:6000:bb00::1/128 inet6: fe80::f169:e3ff:fe2a:23c0/64 Instance ID 0, Interface MTU 1420 (autodetect: 1420) MTU mismatch detection: enabled Area ID 0.0.0.0, Cost 100 State PointToPoint, Transmit Delay 1 sec, Priority 1 Timer intervals configured: Hello 10, Dead 40, Retransmit 5 DR: 0.0.0.0 BDR: 0.0.0.0 Number of I/F scoped LSAs is 2 0 Pending LSAs for LSUpdate in Time 00:00:00 [thread off] 0 Pending LSAs for LSAck in Time 00:00:00 [thread off]
The expected result: Interface cost to be 10
The actual result: interface cost is 100
This severely messes up routing giving directly connected interfaces a lower priority than multihop ones