hi
I've been testing a behavior in our VyOS-CLI , it happens when you want to add an extra route static with the same prefix but different next-hop (interfaces) ,let me show :
# dhcp interfaces vyos@vyos# run show dhcp client lease interface : eth0 ip address : 192.168.122.60 [Active] subnet mask: 255.255.255.0 router : 192.168.122.1 name server: 192.168.122.1 dhcp server: 192.168.122.1 lease time : 3600 last update: Thu Jan 27 18:13:13 UTC 2022 expiry : Thu Jan 27 19:13:08 UTC 2022 reason : BOUND interface : eth1 ip address : 10.10.10.2 [Active] subnet mask: 255.255.255.0 router : 10.10.10.1 name server: 10.10.10.1 dhcp server: 10.10.10.1 lease time : 86400 last update: Thu Jan 27 18:14:29 UTC 2022 expiry : Fri Jan 28 18:14:25 UTC 2022 reason : BOUND
first we add our route static again eth0
vyos@vyos# set protocols static route 1.1.1.1/32 dhcp-interface eth0 vyos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup S>* 0.0.0.0/0 [210/0] via 10.10.10.1, eth1, weight 1, 00:07:23 * via 192.168.122.1, eth0, weight 1, 00:07:23 S>* 1.1.1.1/32 [1/0] via 192.168.122.1, eth0, weight 1, 00:00:12
then we add an extra static with the same prefix but using a different interfaces (eth1)
set protocols static route 1.1.1.1/32 dhcp-interface eth1
after we should see these two static on our VyOS-cli but it doesn't happen .however if you check the RIB (route table) these routes are showing:
vyos@vyos# run show configuration commands | match static set protocols static route 1.1.1.1/32 dhcp-interface 'eth1' [edit] vyos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup S>* 0.0.0.0/0 [210/0] via 10.10.10.1, eth1, weight 1, 00:30:04 * via 192.168.122.1, eth0, weight 1, 00:30:04 S>* 1.1.1.1/32 [1/0] via 10.10.10.1, eth1, weight 1, 00:22:00 * via 192.168.122.1, eth0, weight 1, 00:22:00 C>* 10.10.10.0/24 is directly connected, eth1, 00:30:05 C>* 192.168.122.0/24 is directly connected, eth0, 00:31:22
it brings some problems , when you want to remove the first static or you compare your current settings with the route table . On FRR shows the following :
vyos@vyos# sudo vtysh -c " show run " Building configuration... Current configuration: ! frr version 7.5.1-20211211-00-g294410782 frr defaults traditional hostname vyos log syslog log facility local7 service integrated-vtysh-config ! ip route 0.0.0.0/0 10.10.10.1 eth1 tag 210 210 ip route 0.0.0.0/0 192.168.122.1 eth0 tag 210 210 ip route 1.1.1.1/32 192.168.122.1 ip route 1.1.1.1/32 10.10.10.1 !
I think correct behavior is to keep both route statics in our cli ( so it should allow removing any static)