HSRP 详解

来源:本站原创 CISCO 超过1,328 views围观 0条评论

默认值

HSRP groups                                     None configured
Standby group number                      0
Standby MAC address     System assigned as: 0000.0c07.acXX, where XX is the HSRP   group number
Standby priority                                 100
Standby delay                                    0 (no delay)
Standby track interface priority          10
Standby hello time                              3 seconds
Standby holdtime                               10 seconds

Step 1 configure terminal

Enter global configuration mode.
Step 2 interface interface-id

Enter interface configuration mode, and enter the Layer 3 interface on
which you want to enable HSRP.
Step 3   standby [group-number] ip [ip-address[secondary]]
Create (or enable) the HSRP group using its number and virtual IP
address.
• (Optional) group-number—The group number on the interface for
which HSRP is being enabled. The range is 0 to 255; the default is 0.
If there is only one HSRP group, you do not need to enter a group
number.
• (Optional on all but one interface) ip-address—The virtual IP address
of the hot standby router interface. You must enter the virtual IP
address for at least one of the interfaces; it can be learned on the other
interfaces.
• (Optional) secondary—The IP address is a secondary hot standby
router interface. If neither router is designated as a secondary or
standby router and no priorities are set, the primary IP addresses are
compared and the higher IP address is the active router, with the next
highest as the standby router.
Step 4 end

Return to privileged EXEC mode.

例:

Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# no switchport
Switch(config-if)# standby 1 ip
Switch(config-if)# end
Switch# show standby

Displaying HSRP Configurations
From privileged EXEC mode, use this command to display HSRP settings:
show standby [interface-id [group]] [brief] [detail]

Configuring HSRP Authentication and Timers

Step 1 configure terminal

Enter global configuration mode.
Step 2 interface interface-id

Enter interface configuration mode, and enter the HSRP
interface on which you want to set authentication.
Step 3 standby [group-number] authentication string

(Optional) authentication string—Enter a string to be carried in
all HSRP messages. The authentication string can be up to eight
characters in length; the default string is cisco.
(Optional) group-number—The group number to which the
command applies.
Step 4 standby [group-number] timers hellotime holdtime
(Optional) Configure the time between hello packets and the
time before other routers declare the active router to be down.
• group-number—The group number to which the command
applies.
• hellotime—The hello interval in seconds. The range is from
1 to 255; the default is 3 seconds.
• holdtime—The time in seconds before the active or standby
router is declared to be down. The range is from 1 to 255;
the default is 10 seconds.
Step 5 end Return to privileged EXEC mode.

Configuring HSRP Priority

Step 1 configure terminal

Enter global configuration mode.
Step 2 interface interface-id

Enter interface configuration mode, and enter the HSRP interface on which you
want to set priority.
Step 3 standby [group-number] priority priority [preempt [delay delay]]

Set a priority value used in choosing the active router. The range is 1 to 255;
the default priority is 100. The highest number represents the highest priority.
• (Optional) group-number—The group number to which the command
applies.
• (Optional) preempt—Select so that when the local router has a higher
priority than the active router, it assumes control as the active router.
• (Optional) delay—Set to cause the local router to postpone taking over the
active role for the shown number of seconds. The range is 0 to
3600(1 hour); the default is 0 (no delay before taking over).
Use the no form of the command to restore the default values.

Step 4 standby [group-number] [priority priority] preempt [delay delay]

Configure the router to preempt, which means that when the local router has
a higher priority than the active router, it assumes control as the active router.
• (Optional) group-number—The group number to which the command
applies.
• (Optional) priority—Enter to set or change the group priority. The range
is 1 to 255; the default is 100.
• (Optional) delay—Set to cause the local router to postpone taking over the
active role for the number of seconds shown. The range is 0 to 3600
(1 hour); the default is 0 (no delay before taking over).
Use the no form of the command to restore the default values.
Step 5 standby [group-number] track type number [interface-priority]

Configure an interface to track other interfaces so that if one of the other
interfaces goes down, the device’s Hot Standby priority is lowered.
• (Optional) group-number—The group number to which the command
applies.
• type—Enter the interface type (combined with interface number) that is
tracked.
• number—Enter the interface number (combined with interface type) that is
tracked.
• (Optional) interface-priority—Enter the amount by which the hot standby
priority for the router is decremented or incremented when the interface
goes down or comes back up. The default value is 10.
Step 6 end Return to privileged EXEC mode.

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文标题:HSRP 详解
本文链接:http://www.jdccie.com/?p=1690转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
上篇文章: