Backup Interfaces

In Theory

A backup interface is an interface that stays inactive as long as the primary interface is in “up/up” state, but becomes active when the primary interface’s protocol status becomes “down”. When the protocol on the primary interface comes back up, the backup interface moves back in a “standby mode”. You should know that if the primary interface is administratively down, the backup interface won’t come up. So to test, you have to do something on the other end. The backup interface can be configured to come up not only when the primary interface is down, but also when it’s utilization reaches a certain threshold:
1
R(config-if)# backup load {enable_threshold|never} {disable_load|never}
Copied!
To prevent link flapping you can delay the switchover using:
1
R(config-if)# backup delay {enable_delay|never} {disable_delay|never}
Copied!

In Practice

Here’s an example:
Backup Interface Example
R1 and R2 are connected over Fa0/0 and Seria1/0 interfaces. We will configure Fa0/0 with ip addresses in 12.0.0.0/24 range S1/0 with addresses in 21.0.0.0/24 range. To test connectivity we will enable one loopback on each router and start rip to to advertise the routes from one to another
1
!On R1:
2
R1(config)# interface Fa0/0
3
R1(config-if)# ip address 12.0.0.1 255.255.255.0
4
R1(config-if)# no shut
5
R1(config-if)# exit
6
R1(config)# interface Serial1/0
7
R1(config-if)# ip address 21.0.0.1 255.255.255.0
8
! On newer IOS version, no need to specify clock rate on the DCE
9
R1(config-if)# no shut
10
R1(config)# interface Lo0
11
R1(config-if)# ip address 1.1.1.1 255.255.255.255
12
R1(config-if)# exit
13
R1(config-if)# router rip
14
R1(config-router)# network 0.0.0.0
15
!On R2:
16
R2(config)# interface Fa0/0
17
R2(config-if)# ip address 12.0.0.2 255.255.255.0
18
R2(config-if)# no shut
19
R2(config-if)# exit
20
R2(config)# interface Serial1/0
21
R2(config-if)# ip address 21.0.0.2 255.255.255.0
22
R2(config-if)# no shut
23
R2(config)# interface Lo0
24
R2(config-if)# ip address 2.2.2.2 255.255.255.255
25
R2(config-if)# exit
26
R2(config-if)# router rip
27
R2(config-router)# network 0.0.0.0
Copied!
Shortly, we should be able to ping each router’s loopback interface, from the other one:
1
!On R1:
2
R1#ping 2.2.2.2
3
Type escape sequence to abort.
4
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
5
!!!!!
6
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/18/24 ms
7
!On R2:
8
R2#ping 1.1.1.1
9
Type escape sequence to abort.
10
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
11
!!!!!
12
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms
Copied!
Let’s verify the routing tables, also.
1
On R1:
2
R1#sh ip route
3
1.0.0.0/32 is subnetted, 1 subnets
4
C 1.1.1.1 is directly connected, Loopback0
5
R 2.0.0.0/8 [120/1] via 21.0.0.2, 00:00:15, Serial1/0
6
[120/1] via 12.0.0.2, 00:00:04, FastEthernet0/0
7
21.0.0.0/24 is subnetted, 1 subnets
8
C 21.0.0.0 is directly connected, Serial1/0
9
12.0.0.0/24 is subnetted, 1 subnets
10
C 12.0.0.0 is directly connected, FastEthernet0/0
11
!On R2:
12
R2#sh ip route
13
R 1.0.0.0/8 [120/1] via 21.0.0.1, 00:00:15, Serial1/0
14
[120/1] via 12.0.0.1, 00:00:06, FastEthernet0/0
15
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
16
C 2.2.2.2/32 is directly connected, Loopback0
17
R 2.0.0.0/8 [120/1] via 12.0.0.1, 00:02:27, FastEthernet0/0
18
21.0.0.0/24 is subnetted, 1 subnets
19
C 21.0.0.0 is directly connected, Serial1/0
20
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
21
C 12.0.0.0/24 is directly connected, FastEthernet0/0
22
R 12.0.0.0/8 [120/1] via 21.0.0.1, 00:03:07, Serial1/0
Copied!
Notice the 2 routes installed for the loopback addresses, one for each physical link.

The good interface

Now let’s enable Fa0/0 as backup for S1/0 on R1. Let’s also start debugging on R1:
1
R1# debug backup
2
R1# conf t
3
R1(config)# interface S1/0
4
R1(config-if)# backup interface Fa0/0
Copied!
As soon as we set Fa0/0 as the backup interface of S1/0, the backup interface goes down, in standby mode:
1
*Mar 1 01:00:25.015: BACKUP(Serial1/0): changed state to "initializing"
2
*Mar 1 01:00:25.015: BACKUP(Serial1/0): secondary interface (FastEthernet0/0) configured
3
*Mar 1 01:00:27.015: BACKUP(Serial1/0): event = timer expired on primary
4
*Mar 1 01:00:27.019: BACKUP(Serial1/0): secondary interface (FastEthernet0/0) moved to standby
5
*Mar 1 01:00:27.023: BACKUP(Serial1/0): changed state to "normal operation"
6
*Mar 1 01:00:29.019: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to standby mode
7
*Mar 1 01:00:30.019: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
8
*Mar 1 01:00:30.019: BACKUP(FastEthernet0/0): event = secondary interface went
Copied!
We can see the status with:
1
R1# show ip interface brief
2
Interface IP-Address OK? Method Status Protocol
3
FastEthernet0/0 12.0.0.1 YES manual standby mode down
4
Serial1/0 21.0.0.1 YES manual up up
5
Loopback0 1.1.1.1 YES manual up up
Copied!
Now let’s shut down the serial link on R2:
1
R2(config)# interface serial0/0
2
R2(config-if)# shut
Copied!
Now, based on the keepalive mechanism, the serial link on R1 will move the link into an “up/down” state in about 30 seconds (3 missed keepalives) and will move the backup interface in forwarding mode:
1
*Mar 1 01:08:53.439: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down
2
*Mar 1 01:08:53.443: BACKUP(Serial1/0): event = primary interface went down
3
*Mar 1 01:08:53.443: BACKUP(Serial1/0): changed state to "waiting to backup"
4
*Mar 1 01:08:53.447: BACKUP(Serial1/0): event = timer expired on primary
5
*Mar 1 01:08:53.459: BACKUP(Serial1/0): secondary interface (FastEthernet0/0) made active
6
*Mar 1 01:08:53.459: BACKUP(Serial1/0): changed state to "backup mode"
7
*Mar 1 01:08:55.447: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
8
*Mar 1 01:08:56.447: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
9
*Mar 1 01:08:56.447: BACKUP(FastEthernet0/0): event = secondary interface came up
10
R1#sh ip int brie
11
Interface IP-Address OK? Method Status Protocol
12
FastEthernet0/0 12.0.0.1 YES manual up up
13
Serial1/0 21.0.0.1 YES manual up down
14
Loopback0 1.1.1.1 YES manual up up
Copied!
The routing protocol converges and we can ping 2.2.2.2 from 1.1.1.1
1
R1#sh ip route
2
Gateway of last resort is not set
3
4
1.0.0.0/32 is subnetted, 1 subnets
5
C 1.1.1.1 is directly connected, Loopback0
6
R 2.0.0.0/8 [120/1] via 12.0.0.2, 00:00:13, FastEthernet0/0
7
12.0.0.0/24 is subnetted, 1 subnets
8
C 12.0.0.0 is directly connected, FastEthernet0/0
9
R1#ping 2.2.2.2 source 1.1.1.1
10
11
Type escape sequence to abort.
12
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
13
Packet sent with a source address of 1.1.1.1
14
!!!!!
15
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/18/24 ms
Copied!
When we bring back up the serial interface on R2, Serial 1/0 will come up on R1 and Fa0/0 will move to standby mode again:
1
R2(config)#int s1/0
2
R2(config-if)#no shut
3
!On R1:
4
*Mar 1 01:18:43.423: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
5
*Mar 1 01:18:43.431: BACKUP(Serial1/0): event = primary interface came up
6
*Mar 1 01:18:43.431: BACKUP(Serial1/0): changed state to "waiting to revert"
7
*Mar 1 01:18:43.439: BACKUP(Serial1/0): event = timer expired on primary
8
*Mar 1 01:18:43.443: BACKUP(Serial1/0): secondary interface (FastEthernet0/0) moved to standby
9
*Mar 1 01:18:43.443: BACKUP(Serial1/0): changed state to "normal operation"
10
*Mar 1 01:18:45.443: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to standby mode
11
*Mar 1 01:18:46.443: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
12
*Mar 1 01:18:46.443: BACKUP(FastEthernet0/0): event = secondary interface went
13
R1#sh ip int brie
14
Interface IP-Address OK? Method Status Protocol
15
FastEthernet0/0 12.0.0.1 YES manual standby mode down
16
Serial1/0 21.0.0.1 YES manual up up
17
Loopback0 1.1.1.1 YES manual up up
Copied!

The bad interface

Things worked as expected when we set a backup for the serial interface. Now let’s try setting the serial interface as the backup for the ethernet interface:
1
R1(config)# interface serial1/0
2
R1(config-if)# no backup interface
3
R1(config-if)# exit
4
R1(config)# interface Fa0/0
5
R1(config-if)# backup interface serial1/0
6
R1(config-if)# end
7
R1# show ip int brie
8
Interface IP-Address OK? Method Status Protocol
9
FastEthernet0/0 12.0.0.1 YES manual up up
10
Serial1/0 21.0.0.1 YES manual standby mode down
11
Loopback0 1.1.1.1 YES manual up up
Copied!
Thinks work as expected, now let’s shut the FastEthernet interface on R2:
1
R2(config)# interface fa0/0
2
R2(config-if)# shut
Copied!
And now we wait… When you have waited long enough, you shoud have noticed that the FastEthernet interface on Fa0/0 never went down. The keepalive mechanism on Ethernet links is not used to test connectivity with another host, but to see if the interface can send and receive Ethernet frames. This is because Ethernet links are not considered point-to-point interfaces and they are expected to find more than one neighbor on the link. Since the link will always be up, the backup interface will remain in standby mode and will not be used for forwarding.
The same thing would happen with other Multipoint interfaces, like the Frame Relay physical interface or the multipoing subinterface. A point-to-point subinterface would move the protocol status to down when the DLCI assigned to it si not active.
The solution here is to use a more advanced tracking system, like Enhanced Object Tracking