Hot Standby Router Protocol HSRP configuration on GNS3:

HSRP is a Cisco proprietary redundancy protocol.  The protocol establishes a framework between network devices in order to achieve default gateway fail-over if the primary gateway should become inaccessible. In HSRP only one device is active as a gateway while other is in standby state. If the active gateway goes down then other standby device take over. This can be useful for dual branch routers each with a single serial link back to the head end.
For HSRP configuration in gns3 I use a simple topology of three switches. For all switch i use the 3640 router IOS with NM-16ESW  module(use a switch in gns3). Switch S-A and S-B are belong to HSRP standby group 1 with IP 10.1.1.10. In HSRP one device is active as a gateway for access devices while other is in standby. The device which have high HSRP priority become active, by default all devices have priority of 100. In our topology I have set a high priority for S-A therefore it is active. Standby group 1 is responsible for changing status of devices as active and standby.  



Switch S-A-configuration:

S-A>en
S-A#configure t
S-A(config)#line vty 0 4
S-A(config-line)#password cisco
S-A(config)#int f0/0
S-A(config-if)#switchport mode trunk
S-A(config)#interface vlan 70
S-A(config-if)#ip address 10.1.1.1 255.255.255.0
S-A(config-if)#no shut
S-A(config-if)#standby 1 ip 10.1.1.10
S-A(config-if)#standby 1 priority 150

Switch S-B-configuration:

S-B(config)#line vty 0 4
S-B(config-line)#password cisco
S-B(config)#int f0/0
S-B(config-if)#switchport mode trunk
S-B(config-if)#no shu
S-B(config)#int f0/1
S-B(config-if)#switchport mode trunk
S-B(config-if)#switchport mode trunk
S-B(config-if)#ex
S-B(config)#interface vlan 70
S-B(config-if)#ip address 10.1.1.2 255.255.255.0
S-B(config-if)#no shut
S-B(config-if)#standby 1 ip 10.1.1.10
S-B#wr
Building configuration...
[OK]
 
R-C configuration

R-C#vlan database
R-C(vlan)#vlan 70
R-C(vlan)#exit
R-C#config t
R-C(config)#int  f0/0

R-C(config-if-range)#switchport access vlan 70
R-C(config-if-range)#switchport mode access
R-C(config)#int  f0/2
R-C(config-if-range)#switchport mode trunk
R-C(config)#int  f0/3
R-C(config-if-range)#switchport mode trunk

Qemu1 Configuration
tc@box:$ sudo su 
root@box:$ Ifconfig eth0 10.1.1.200 netmask 255.255.255.0
root@box:$ Route add default gw 10.1.1.2 eth0

 Verification:
  1.  Telnet 10.1.1.10 for qemu1, 10.1.1.10 is standby group 1 IP address and is belong to active device. Since S-A have high priority therefore S-A is gateway for qemu1 even we hard coded qemu1 GW 10.1.1.2 which is S-B. Result: Telnet 10.1.1.10 login into S-A.
  2. Now to verify that standby device become active on fail-over stop the S-A and after 30s telnet 10.1.1.10 you should be in S-B.
Useful link: VRRP configuration on GNS3
Thanks...

17 comments:

  1. May I know the IOS version and sw / router module that is being used in order to configure VRRP and HSRP ? So far I am not able to use "standby" command and "vrrp" commands. I used "c3640-jk9o3s-mz.124-16a" IOS and using "NM-16ESW" , "NM-1FE-TX". But still cannot use "standby" and "vrrp"commands. Pls. advise.

    ReplyDelete
    Replies
    1. hello,
      you cannot configure HSRP on serial interface...

      Delete
  2. thanks ... i followed your lab and it works... great help to learn hsrp. Keep up the good work

    ReplyDelete
  3. Thx mite. Usefull.

    Now we can fire the world.

    ReplyDelete
  4. I cant ping the routers neither from the switch or the PC...

    ReplyDelete
    Replies
    1. can u ping from router to switches???

      Delete
    2. thanks it is solved some missing config

      Delete
    3. what was your missing config i have the same issue

      Delete
  5. Charan : Great help ...Thanks

    ReplyDelete
  6. I have one Router 3700 and two SW L3, I use three vlan 20, 30, 40 then how's configuration HSRP??? Thanks

    L3 SW -----
    |Router 3700

    L3 SW------|

    ReplyDelete
  7. yeah u can ping switches from ur router , give ip address to switch on interface vlan 70 in same subnet .

    ReplyDelete
  8. This page awesome thank you

    ReplyDelete
  9. pls help me!
    Before rebooting L3 Switch, HSRP is working well and then i saved config files . After rebooting switches , HSRP was not running at all.Why???

    ReplyDelete
  10. here is a complete config


    hostname S-A

    vlan database
    vlan 70

    interface FastEthernet0/0
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address
    !
    interface FastEthernet0/1
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address
    !


    !
    interface Vlan70
    ip address 10.1.1.1 255.255.255.0
    standby 1 ip 10.1.1.10
    standby 1 priority 150


    hostname S-B

    vlan database
    vlan 70

    interface FastEthernet0/0
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address
    !
    interface FastEthernet0/1
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address
    !


    !
    interface Vlan70
    ip address 10.1.1.2 255.255.255.0
    standby 1 ip 10.1.1.10
    standby 1 priority 150

    hostname S-C
    !

    vlan database
    vlan 70
    !
    interface FastEthernet0/0
    switchport access vlan 70
    no ip address
    !

    interface FastEthernet0/2
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address
    !
    interface FastEthernet0/3
    switchport trunk native vlan 70
    switchport mode trunk
    no ip address


    ReplyDelete
  11. useful post thanks

    ReplyDelete

UA-23728446-1