Monday, July 4, 2011

First Hop Redundancy Protocols Part 1 - Fault Tolerant Shortest path gateway using HSRP priority tracker

Here is the implementation of HSRP(Hot Standby Router Protocol) protocol with serial links on the WAN side. The priority of the Active router can be reduced so that stand-by router can kick-in to save the day.


Router R1 Configuration -
interface FastEthernet0/0
 description Inbound path to R1
 ip address 192.168.56.250 255.255.255.0
 duplex auto
 speed auto
 standby ip 192.168.56.252
 standby timers 5 15
 standby priority 125
 standby preempt
 standby authentication ninja
 standby mac-address 0000.0c10.bd10
 standby track Serial0/0

!
interface Serial0/0
 description Serial Link 1 to WAN router R3
 ip address 172.17.1.1 255.255.255.0
!
interface FastEthernet0/1
 description outbound path to R2
 ip address 172.16.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/1
 no ip address
 shutdown
!
ip classless
ip route 172.18.1.0 255.255.255.0 172.16.1.2
ip route 172.18.1.0 255.255.255.0 172.17.1.2
ip route 192.168.57.0 255.255.255.0 172.17.1.2
ip route 192.168.57.0 255.255.255.0 172.16.1.2 2
no ip http server
no ip http secure-server

Router R2 Configuration - 
interface FastEthernet0/0
 description Inbound path to R2
 ip address 192.168.56.251 255.255.255.0
 duplex auto
 speed auto
 standby ip 192.168.56.252
 standby timers 5 15
 standby priority 120
 standby preempt
 standby authentication ninja
 standby mac-address 0000.0c10.bd11

!
interface Serial0/0
 description Serial Link 2 to WAN Router R3
 ip address 172.18.1.1 255.255.255.0
!
interface FastEthernet0/1
 description Outbound path to R1
 ip address 172.16.1.2 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/1
 no ip address
 shutdown
!
ip classless
ip route 172.17.1.0 255.255.255.0 172.16.1.1
ip route 172.17.1.0 255.255.255.0 172.18.1.2
ip route 192.168.57.0 255.255.255.0 172.18.1.2
ip route 192.168.57.0 255.255.255.0 172.16.1.1
no ip http server
no ip http secure-server

Router R3 configuration -
interface FastEthernet0/0
 description Gateway Interface for Network on WAN Side
 ip address 192.168.57.250 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0
 description Serial Link 1 from remote side router R1
 ip address 172.17.1.2 255.255.255.0
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 description description Serial Link 2 from remote side router R2
 ip address 172.18.1.2 255.255.255.0
!
ip classless
ip route 172.16.1.0 255.255.255.0 172.17.1.1
ip route 172.16.1.0 255.255.255.0 172.18.1.1
ip route 192.168.56.0 255.255.255.0 172.17.1.1
ip route 192.168.56.0 255.255.255.0 172.18.1.1 2
no ip http server
no ip http secure-server

Redundant routes are applied from 172.16.1.0 network with metric distances to provide the second path.
Static priority without track interface will cause to remain R1 as active. The packet then will have to traverse 1 more hop to go through 172.16.1.0 network. Though it is good to have backup paths but purpose of this scenario is to provide shortest path. Default priority decrement is 10.
Router R1 tracks R1 s0/0 interface. If this is UP then priority remains as 125 & active router will be R1.
If this link goes down priority becomes 115 for R1, lower than R2. Preempt function overthrows this router & R2 becomes active. Without priority tracking packets will be routed through R1 ---> R2 ---> R3.

R1 s0/0 interface UP -
R1#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.56.250  YES NVRAM  up                    up
Serial0/0                  172.17.1.1      YES NVRAM  up                    up
FastEthernet0/1            172.16.1.1      YES NVRAM  up                    up
Serial0/1                  unassigned      YES NVRAM  administratively down down
R1#sh stan
R1#sh standby
FastEthernet0/0 - Group 0
  State is Active
    15 state changes, last state change 00:29:48
  Virtual IP address is 192.168.56.252
  Active virtual MAC address is 0000.0c10.bd10
    Local virtual MAC address is 0000.0c10.bd10 (confgd)
  Hello time 5 sec, hold time 15 sec
    Next hello sent in 1.828 secs
  Authentication text "ninja"
  Preemption enabled
  Active router is local
  Standby router is 192.168.56.251, priority 120 (expires in 11.708 sec)

  Priority 125 (configured 125)
    Track interface Serial0/0 state Up decrement 10
  IP redundancy name is "hsrp-Fa0/0-0" (default)
R1#

R1 s0/0 interface Down -
R1#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.56.250  YES NVRAM  up                    up
Serial0/0                  172.17.1.1      YES NVRAM  administratively down down
FastEthernet0/1            172.16.1.1      YES NVRAM  up                    up
Serial0/1                  unassigned      YES NVRAM  administratively down down
R1#sh standb
R1#sh standby
FastEthernet0/0 - Group 0
  State is Speak
    16 state changes, last state change 00:00:13
  Virtual IP address is 192.168.56.252
  Active virtual MAC address is 0000.0c10.bd11
    Local virtual MAC address is 0000.0c10.bd10 (confgd)
  Hello time 5 sec, hold time 15 sec
    Next hello sent in 1.328 secs
  Authentication text "ninja"
  Preemption enabled
  Active router is 192.168.56.251, priority 120 (expires in 11.320 sec)
  Standby router is unknown
  Priority 115 (configured 125)
    Track interface Serial0/0 state Down decrement 10

  IP redundancy name is "hsrp-Fa0/0-0" (default)
R1#

In this way HSRP helps us to provide gateway redundancy with Virtual IP (VIP). GLBP (Gateway Load Balancing Protocol) & HSRP are closely related with some differences. My next experiment will be with GLBP protocol. Happy Networking.

No comments:

Post a Comment