If on two routers with the redistribution of static routes enabled, create the same routes and then delete them, the route will loop.
сonfiguration router 1 (vyos1):
interfaces { ethernet eth0 { address 192.168.0.1/24 } loopback lo { } } protocols { ospf { area 0 { network 192.168.0.0/24 } redistribute { static { } } } } service { ssh {
сonfiguration router 2 (vyos2):
interfaces { ethernet eth0 { address 192.168.0.2/24 } loopback lo { } } protocols { ospf { area 0 { network 192.168.0.0/24 } redistribute { static { } } } } service { ssh {
[email protected]:~$ show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 192.168.0.2 1 Full/DR 31.039s 192.168.0.2 eth0:192.168.0.1 0 0 0
Create a route on a router 1:
[email protected]:~$ conf [email protected]# set protocols static route 192.168.100.0/24 blackhole [email protected]# commit [email protected]# exit
[email protected]:~$ 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 O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:08:04 C>* 192.168.0.0/24 is directly connected, eth0, 00:09:19 O>* 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:01:03
Create a route on a router 2:
[email protected]:~$ conf [email protected]# set protocols static route 192.168.100.0/24 blackhole [email protected]:~$ 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 O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:09:59 C>* 192.168.0.0/24 is directly connected, eth0, 00:11:14 S>* 192.168.100.0/24 [1/0] unreachable (blackhole), 00:00:30 O 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:00:40
Remove the route on both routers:
[email protected]# delete protocols static route 192.168.100.0/24 [email protected]# commit [email protected]# delete protocols static route 192.168.100.0/24 [email protected]# commit
And show:
[email protected]:~$ 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 O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:11:31 C>* 192.168.0.0/24 is directly connected, eth0, 00:13:28 O>* 192.168.100.0/24 [110/20] via 192.168.0.2, eth0, 00:02:47
[email protected]:~$ 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 O 192.168.0.0/24 [110/1] is directly connected, eth0, 00:11:28 C>* 192.168.0.0/24 is directly connected, eth0, 00:12:43 O>* 192.168.100.0/24 [110/20] via 192.168.0.1, eth0, 00:02:09
Now I got a route loop. The problem is solved by rebooting routers.