Thursday 1 November 2018

What is HSRP-(Hot Standby Routing Protocol)?

Hot Standby Routing Protocol (HSRP)  is a cisco proprietary  redundancy protocol that provides  back up to a router in the event of failure.

 HSRP allow you to configure two or more routers into a standby group to present the appearance of single Virtual router on the LAN. The router share the same IP address and MAC address. therefore in the event of failure of one router the host on the LAN are able to continue forwarding packets to a consistent IP and MAC address. HSRP is not provide load-balancing.






Each standby group that you define include the following routers:

  • Active router
  • Standby router
  • Virtual router
  • Any other routers that maybe attached to the subnet
Active router one router is active and other two or more routers just sit there in standby mode and won't be active unless a failure occur. 

Standby router the standby group will always have at least two routers that participating in it. The primary players in the group are the active router and one standby router that communicate to each other using multicast hello messages, hello timer in HSRP 3 seconds and hold timer is 10 seconds.

Virtual router in an HSRP group has a virtual IP address and  virtual MAC address. virtual router is not a physical router entity. the physical router that communicates as the virtual router is the current active router.

Other routers just monitor the hello messages sent by the active and standby routers to ensure that an active and standby router exists for the HSRP  group that they belong to.

Interface tracking 

HSRP enable routers can track the interface status of the outside interface. if the outside link of the active router goes down, the standby router will take over and become the active router. There is a default priority of 100 if you raise the priority  its means your router has higher priority to become active router.



HSRP configuration


Topology:

GOAL:
  • configure the basic IP addressing on routers as per our diagram & ensure the connectivity
  • configure R4 as the connected PC in LAN, for verification in the LAN
  • configure default route on R1/R3 to reach routes on Internet
  • configure Static router on R2-ISP back to LAN network on both sides
  • configure HSRP on R1 and R3 under F0/0 and use Virtual Gateway IP address as 192.168.1.150/24
  • make sure that R1 becomes primary and R2 as backup
  • Active Gateway Priority 120 and the standby are left at the default
  • authentication between both switches MD5 password "internetworking"
  • standby will take up active role in a 5 seconds incase if hello packets not received
  • the primary gateway should have the ability to resume the primary role once primary router or track interface is reachable (preempt)
  • make sure that the reachability to internet should be established even if the WAN interface  (R1 s3/0) goes down

R1(config)#interface serial 3/0
R1(config-if)#ip address 10.1.1.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.1.100 255.255.255.0
R1(config-if)#no shutdown
R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2

*Nov  1 14:21:09.983: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config)#interface serial 3/0
R2(config-if)#ip address 10.1.1.2 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit

*Nov  1 14:26:04.711: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up

R2(config)#interface serial 3/1
R2(config-if)#ip address 11.1.1.2 255.0.0.0
R2(config-if)#no shutdown

*Nov  1 14:26:47.975: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/1, changed state to up


R2(config)#interface loopback 0
R2(config-if)#ip address 12.0.0.1 255.255.255.0
R2(config-if)#exit

*Nov  1 14:33:34.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R2(config)#interface loopback 1
R2(config-if)#ip address 12.0.1.1 255.255.255.0
R2(config-if)#exit
*Nov  1 14:34:23.395: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

R2(config)#ip route 192.168.1.0 255.255.255.0 10.1.1.1
R2(config)#ip route 192.168.1.0 255.255.255.0 11.1.1.1

R3(config)#interface serial 3/1
R3(config-if)#ip address 11.1.1.1 255.0.0.0
R3(config-if)#no shutdown
R3(config-if)#exit

*Nov  1 14:24:30.387: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/1, changed state to up

R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.1.200 255.0.0.0
R3(config-if)#no shutdown
R3(config)#ip route 0.0.0.0 0.0.0.0 11.1.1.2



On R4:

R4(config)#hostname client-R4
client-R4(config)#no ip routing
client-R4(config)#interface fastEthernet 0/0
client-R4(config-if)#ip address 192.168.1.1 255.255.255.0
client-R4(config-if)#no shutdown

*Nov  1 14:41:14.479: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

client-R4(config)#ip default-gateway 192.168.1.150

R1(config)#interface fastEthernet 0/0
R1(config-if)#standby 12 ip 192.168.1.150
R1(config-if)#standby 12 priority 120
R1(config-if)#standby 12 preempt
R1(config-if)#standby 12 track  serial 3/0 30
R1(config-if)#standby 12 authentication md5 key-string internetworking

R1(config-if)#standby 12 timers 1 5

*Nov  1 14:43:54.367: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 12 state Standby -> Active
R3(config)#interface fastEthernet 0/0
R3(config-if)#standby 12 ip 192.168.1.150
R3(config-if)#standby 12 preempt
R3(config-if)#standby 12 authentication md5 key-string internetworking
R3(config-if)#standby 12 timers 1 5

*Nov  1 14:51:52.051: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 12 state Speak -> Standby

R3#ping 192.168.1.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/36 ms


R1#show standby
FastEthernet0/0 - Group 12
  State is Active
    2 state changes, last state change 00:11:09
  Virtual IP address is 192.168.1.150
  Active virtual MAC address is 0000.0c07.ac0c (MAC In Use)
    Local virtual MAC address is 0000.0c07.ac0c (v1 default)
  Hello time 1 sec, hold time 5 sec
    Next hello sent in 0.208 secs
  Authentication MD5, key-string
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.200, priority 100 (expires in 5.680 sec)
  Priority 120 (configured 120)
    Track interface Serial3/0 state Up decrement 10
  Group name is "hsrp-Fa0/0-12" (default)

R1#show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       12   120 P Active  local           192.168.1.200   192.168.1.150

R3#show standby
FastEthernet0/0 - Group 12
  State is Standby
    4 state changes, last state change 00:09:18
  Virtual IP address is 192.168.1.150
  Active virtual MAC address is 0000.0c07.ac0c (MAC Not In Use)
    Local virtual MAC address is 0000.0c07.ac0c (v1 default)
  Hello time 1 sec, hold time 5 sec
    Next hello sent in 0.544 secs
  Authentication MD5, key-string
  Preemption enabled
  Active router is 192.168.1.100, priority 120 (expires in 5.296 sec)
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-12" (default)

R3#show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp    Pri P   State          Active          Standby         Virtual IP
Fa0/0          12   100 P   Standby  192.168.1.100   local           192.168.1.150


client-R4#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

-R4#ping 192.168.1.150
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.150, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/56/68 ms

client-R4#ping 192.168.1.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/257/1036 ms

client-R4#ping 192.168.1.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/268/1092 ms

client-R4#ping 12.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/92/108 ms

client-R4#traceroute 12.0.1.1
Type escape sequence to abort.
Tracing the route to 12.0.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.1.100 32 msec 48 msec 32 msec
  2 10.1.1.2 68 msec 84 msec 68 msec


R3#show standby
FastEthernet0/0 - Group 12
  State is Standby
    4 state changes, last state change 00:35:00
  Virtual IP address is 192.168.1.150
  Active virtual MAC address is 0000.0c07.ac0c (MAC Not In Use)
    Local virtual MAC address is 0000.0c07.ac0c (v1 default)
  Hello time 1 sec, hold time 5 sec
    Next hello sent in 0.016 secs
  Authentication MD5, key-string
  Preemption enabled
  Active router is 192.168.1.100, priority 120 (expires in 4.752 sec)
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-12" (default)

we shutdown serial 3/0 just to check the redundancy

R1(config)#interface serial 3/0
R1(config-if)#shutdown

*Nov  1 15:29:37.131: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to down



R3#show standby
FastEthernet0/0 - Group 12
  State is Active
    5 state changes, last state change 00:00:06
  Virtual IP address is 192.168.1.150
  Active virtual MAC address is 0000.0c07.ac0c (MAC In Use)
    Local virtual MAC address is 0000.0c07.ac0c (v1 default)
  Hello time 1 sec, hold time 5 sec
    Next hello sent in 0.608 secs
  Authentication MD5, key-string
  Preemption enabled
  Active router is local
  Standby router is unknown
  Priority 100 (default 100)
  Group name is "hsrp-Fa0/0-12" (default)


R1(config)#interface serial 3/0
R1(config-if)#no shutdown 
R1(config-if)#exit

R1#show standby
FastEthernet0/0 - Group 12
  State is Active
    4 state changes, last state change 00:00:41
  Virtual IP address is 192.168.1.150
  Active virtual MAC address is 0000.0c07.ac0c (MAC In Use)
    Local virtual MAC address is 0000.0c07.ac0c (v1 default)
  Hello time 1 sec, hold time 5 sec
    Next hello sent in 0.272 secs
  Authentication MD5, key-string
  Preemption enabled
  Active router is local
  Standby router is 192.168.1.200, priority 100 (expires in 4.432 sec)
  Priority 120 (configured 120)
    Track interface Serial3/0 state Up decrement 30
  Group name is "hsrp-Fa0/0-12" (default)














 


 


Instagram

Facebook


Twitter



LINKEDIN








No comments:

What is Virtual Router Redundancy Protocol (VRRP)? How to configure Virtual Router Redundancy Protocol (VRRP)?

 Virtual Router Redundancy Protocol (VRRP) is a gateway redundancy networking protocol used to create a virtual gateway similar to HSRP . VR...