Open sglaus opened 3 years ago
For someone looking into this in the future – I spent some time on this and I think it's a kernel issue. I was testing on kernel 5.4.
Here is a list of commands to reproduce all the messages FRR sends to the kernel in this case:
ip link add dummy0 type dummy
ip link set dummy0 up
ip link add dummy1 type dummy
ip link set dummy1 up
ip nexthop add id 100 dev dummy0
ip nexthop add id 101 dev dummy1
ip nexthop add id 102 group 100/101
ip route add 1.1.1.1/32 nhid 102
ip nexthop add id 103 via 1.1.1.1 dev dummy0 onlink
ip nexthop add id 104 via 1.1.1.1 dev dummy1 onlink
ip nexthop add id 105 group 103/104
ip route add 2.2.2.2/32 nhid 105
ip -6 nexthop add id 200 dev dummy0
ip -6 nexthop add id 201 dev dummy1
ip nexthop add id 202 group 200/201
ip -6 route add 1::1/128 nhid 202
ip -6 nexthop add id 203 via 1::1 dev dummy0 onlink
ip -6 nexthop add id 204 via 1::1 dev dummy1 onlink <-- this command fails with "Nexthop has invalid gateway or device mismatch."
ip nexthop add id 205 group 203/204
ip -6 route add 2::2/128 nhid 205
As we can see, when we're trying to add the second onlink IPv6 nexthop, kernel rejects it with "Nexthop has invalid gateway or device mismatch." error. The same set of commands works perfectly in IPv4 case above. By the way, we can successfully add the second IPv6 nexthop without the onlink
flag and it works, which is also not correct I suppose.
Describe the bug Using FRR 7.5.
I have an IPv6 static route configured (2::1/128):
The routes to 2::1/128 have been configured with nexthop interfaces. If I now configure another static route, and use 2::1/128 as the nexthop, it is rejected by the kernel:
...and I see these errors in the log:
If I re-configure the 2::1/128 static, and configure nexthop addresses instead of interfaces, then I can add the 51:1:1::/64 static without any problem, so this issue seems related to the use of nexthop interfaces with recursive routes.
Interestingly, if I configure a recursive static with a mix of nexthop interface and nexthop addresses, the static is no longer flagged as rejected (even though it is). In the example below, 51:1:1::/64 is configured with two nexthops - 2::1/128 and 2::2/128.
The RIB has flagged 51:1:1::/64 as FIB route, even though the route has not been installed in the kernel:
[x] Did you check if this is a duplicate issue? [x] Did you test it on the latest FRRouting/frr master branch?