Last Updated on August 1, 2021 by Admin 2
Which command enables HSRP on an interface?
- standby ip
- standby mode hsrp
- switchport mode hsrp
The standby ip interface configuration command enables Hot Standby Router Protocol (HSRP). The syntax for this command is as follows:
switch(config-if)# standby group-number ip ip-address
The group-number argument specifies the HSRP group number on the interface. You do not need to enter a group number if there is only one HSRP group.
At least one interface on one of the routers in the group must be configured with the virtual IP address of the group. It is optional on all other interfaces on the other routers, which can learn the address through the hellos sent among the group.
A complete HSRP configuration is shown below with an explanation of each command.
RouterA (config) #interface Fa0/1 RouterA (config-if) # ip address 192.168.5.6 255.255.255.0 RouterA (config-if) # standby 2 ip 192.168.5.10 RourerA(config-if) # standby 2 priority 150 RouterA (config-if) #standby 2 Preempt RouterA(config-if) #standby 2 track interface fa0/2
- Line 1 specifies the interface
- Line 2 addresses the interface
- Line 3 specifies the HSRP group number and the virtual IP address
- Line 4 sets the HSRP priority
- Line 5 allows the router to take the active role if its priority becomes higher than that of the active router
In the above, the router is tracking its own Fa0/1 interface. If that interface goes down it will reduce its priority by 10 (this is the default decrement when not specified). The new value would be 140 if that happened. To specify a decrement value, add it to the track command, as in this example: track interface Fa0/2 20.
When you configure routers to be part of an HSRP group, they listen for the HSRP MAC address for that group as well as their own burned-in MAC addresses.
HSRP uses the following MAC address:
0000.0c07.ac** (where ** is the HSRP group number)
The switchport mode interface configuration command will configure the VLAN membership mode of a port. It is not used to enable HSRP.
The options standby mode hsrp and hsrp are not valid commands.
Configure and verify first-hop redundancy protocols