Unetlab: Backup static route is not used when peer router’s interface is down



In GNS3 or in unetlab when the peer router’s (seemed) directly connected interface is down, your local router interface is still up. This is because the so-call directly connected is connected via a virtual bridge.

In this lab I have created floating static route to simulate uRPF scenario, however because R1 does not know that R2’s ethernet0/0 interface was shutdown, R1’s ethernet0/0 is still up and hence the primary static route is still installed in the routing table causing traffic destined to is blackholed.

!R1's primary route is still in the routing table despite R2's e0/0 was shutdown.
!R1 is configured to use the secondary static route if is not reachable via ! (which is R2's e0/0)

ip route name "via R2 e0/0"
ip route 2 name "via R2 e0/1"
R1#sh ip route static is subnetted, 1 subnets
S [1/0] via, Ethernet0/0

R1#sh ip int brief | in 0/0
Ethernet0/0           YES NVRAM  up                    up  

The solution is to used Bidirectional forwarding detection on static routes

1. R1 and R2 needs to have the BFD configured in order to form BFD neighborship.
2. R1 and R2 interface has to configure BFD timers.
3. BFD echo is enabled by default per router’s interface.
4. Configure BFD for static route
5. Configure static route and specify the exit interface.

R1#sh run int e0/0

!Configure BFD timer. This means transmit every 50ms and receive every 50ms
!If BFD timer exceeds 250ms the BFD neighbor is declared dead.
interface Ethernet0/0
 ip address
 no ip redirects
 bfd interval 50 min_rx 50 multiplier 5

R1#sh run | in ip route static
!Configure the bfd for static route neighbor
ip route static bfd Ethernet0/0
ip route static bfd Ethernet0/1

R1#sh run | in ip route
!Specifies the ip static route bfd neighbor.
ip route Ethernet0/0
ip route Ethernet0/1 2

When the BFD neighbor is formed you will see this syslog message:

*Feb 21 17:33:26.226: %BFDFSM-6-BFD_SESS_UP: BFD-SYSLOG: BFD session ld:1 handle:1 is going UP


R1#sh bfd neighbors

IPv4 Sessions
NeighAddr                              LD/RD         RH/RS     State     Int                             1/1          Up        Up        Et0/0                             2/2          Up        Up        Et0/1

When R2 shutsdown e0/0, R1 should use the secondary route.

*Feb 21 17:59:48.504: %BFDFSM-6-BFD_SESS_DOWN: BFD-SYSLOG: BFD session ld:1 handle:1,is going Down Reason: ECHO FAILURE

R1#sh ip route static is subnetted, 1 subnets
S [2/0] via, Ethernet0/1

One thought on “Unetlab: Backup static route is not used when peer router’s interface is down

  1. Hi which GNS image you used on router… because in my lab simulation ip route static is not coming.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s