cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

hardware:cisco:hsrp.html



Cisco HSRP, MHSRP Configuration Examples

About HSRP

  • Hot Stanby Router Protocol
  • Redundant default gateway
  • How to automatically switch virtual IP addresses in case of failure


About MHSRP

  • Multiple Hot Stanby Router Protocol
  • How to distribute load while maintaining redundancy


Commands

Check

Operation Commands
Check HSRP Router# show stanby brief
Router# show stanby
Router# show hsrp brief ← Nexus
Router# show hsrp ← Nexus

Set

Operation Commands
Enable HSRP Router(config-if )# stanby GROUP ip IPADDRESS
Router(config-if )# stanby 1 ip 192.168.0.10
Set the virtual MAC address Router(config-if )# stanby GROUPNUMBER MACADDRESS
Router(config-if )# stanby 1 0000.01aa.aaaa
Set group name Router(config-if )# stanby GROUPNUMBER name GROUPNAME
Router(config-if )# stanby 1 name TestHSRP
Set HSRP priority Router(config-if )# stanby GROUPNUMBER priority PRIORITY
Router(config-if )# stanby 1 priority 150
The default priority is 100.
The router with the higher priority becomes active.
If the priority is the same, the router with the larger IP address becomes active.
Configure HSRP preemption Router(config-if )# stanby GROUPNUMBER preempt delay SECOND
Router(config-if )# stanby 1 preempt delay 250
Preemption is a function to regain its role as an active router in case of recovery.
By delaying the transition time to the active router by specifying the delay option,
You can complete routing protocol convergence and NAT table synchronization.
Set the HSRP timer Router(config-if )# stanby GROUPNUMBER timers HELLOTIME HOLDTIME
Router(config-if )# stanby 1 timers 5 15
Hello time is the interval at which Hello messages are sent. (Default is 3 seconds)
Hold time is the time it takes to consider a router to be down. (Default is 10 seconds)
Enable interface tracking Router(config-if )# stanby GROUPNUMBER timers INTERFACE DECREASEVALUE
Router(config-if )# stanby 1 timers Serial 0/0 20
The interface tracking function is to monitor (track) an interface for which an asynchronous router has not set up HSRP, and to lower its own priority to the standby router when the interface goes down.
The default for decreasing values is 10.


Command Example

https://www.cisco.com/c/en/us/td/docs/ios/ipapp/command/reference/iap_s4.html#wp1140784

Router# show standby brief

 Interface   Grp Prio P State    Active addr     Standby addr    Group addr     
 Et0         0   120    Init     10.0.0.1        unknown         10.0.0.12 

Router# show standby

 Ethernet0/1 - Group 1
   State is Active
    2 state changes, last state change 00:30:59
   Virtual IP address is 10.1.0.20
    Secondary virtual IP address 10.1.0.21
   Active virtual MAC address is 0004.4d82.7981
    Local virtual MAC address is 0004.4d82.7981 (bia)
   Hello time 4 sec, hold time 12 sec
    Next hello sent in 1.412 secs
   Gratuitous ARP 14 sent, next in 7.412 secs
   Preemption enabled, min delay 50 sec, sync delay 40 sec
   Active router is local
   Standby router is 10.1.0.6, priority 75 (expires in 9.184 sec)
   Priority 95 (configured 120)
    Tracking 2 objects, 0 up
       Down Interface Ethernet0/2, pri 15
       Down Interface Ethernet0/3
 Group name is "HSRP1" (cfgd)
 Follow by groups:
     Et1/0.3 Grp 2 Active 10.0.0.254 0000.0c07.ac02 refresh 30 secs (next 19.666)
     Et1/0.4 Grp 2 Active 10.0.0.254 0000.0c07.ac02 refresh 30 secs (next 19.491)
   Group name is "HSRP1", advertisement interval is 34 sec


Setting Example

HSRP

HSPR : 192.168.1.1
Host1 : 192.168.1.2/24
Host2 : 192.168.1.3/24
Router A

Host1 > enable
Host1# configure terminal
Host1(config)# interface vlan 1
Host1(config-if)# ip  address 192.168.1.2  255.255.255.0
Host1(config-if)# standby 1 ip 192.168.1.1  <- VIP
Host1(config-if)# standby 1 priority 105
Host1(config-if)# standby 1 preempt delay minimum 10   <- When the active side is restored Automatic trimming back in ten seconds
Host1(config-if)# no shutdown
Host1(config-if)# exit
Host1(config)# exit
Host1# copy running-config startup-config

Router B



hardware/cisco/hsrp.html.txt · Last modified: 2019/06/11 by admin

Page Tools