Typical application – interface backup using policy-based routing

Last Updated : Jul 06, 2020 |

In the previous typical application, the backup interface command is used to specify a backup interface. This typical application illustrates an alternative to the backup interface command, using policy-based routing (PBR) which configures a routing scheme for specified traffic based on configured characteristics of the traffic. Thus, PBR can be used in combination with object tracking to configure a backup mechanism for interfaces.

For an example that uses policy-based routing as an alternative to the backup interface command, replace the last four lines of the previous typical application with the example below. The example creates a next hop list that sends the specified traffic to the WAN FastEthernet interface that is running PPPoE encapsulation. If the WAN FastEthernet interface becomes unavailable, the next hop list routes the traffic to the Serial interface 3/1:1. PBR list 801 is created and assigned to interface VLAN 1, so that traffic defined in PBR list 801 passing through interface VLAN 1 is routed according to the next hop list.

Note:

You can define a static route over the WAN FastEthernet interface running DHCP client. In such a case, the static route uses as the next hop the default router learned from the DHCP server. This is useful for GRE tunnels which are defined over the WAN Fast Ethernet running DHCP client. It is necessary to define static routes in order to prevent loops. Therefore, the IP route command allows configuration of static routes over WAN Fast Ethernet running DHCP client.

When the WAN Fast Ethernet is up, policy-based routing routes this traffic via the WAN FastEthernet interface. When the track list defined in the previous typical application is down, policy-based routing routes this traffic through the Serial interface 3/1:1. When the track list is up again, the traffic is again routed through the WAN FastEthernet interface.

! Create PBR list 801. This list routes traffic from IP address 
! 149.49.42.1 to IP address 149.49.43.1 according to next hop list 10.
!
ip pbr-list 801
    name list #801
    ip-rule 10
       next-hop list 10
       source-ip host 149.49.42.1 
       destination-ip host 149.49.43.1
       exit
     exit
!
! Assign PBR list 801 to interface Vlan 1.
!
interface Vlan 1
    icc-vlan
    ip pbr-group 801
    ip address 149.49.42.254   255.255.255.0  
    exit
!
! Configure next hop list 10 with interface fastethernet 10/2 as the
! first next hop, and interface Serial 3/1:1 as the second next hop.
!
ip next-hop-list 10
    next-hop-interface 1 FastEthernet 10/2
    next-hop-interface 2 Serial 3/1:1
exit