Cisco-HSRP配置实验

实验拓朴图

loopback 2 loopback 3
2.2.2.2 3.3.3.3
| |
| |
sw2————-(Vip:172.16.1.1)———-sw3
172.16.1.2 172.16.1.3
| |
| |
| |
| |
—————–SW1————————
|
|
VPC 1

一、配置完成后,sho standby bri 查看HSRP当前状态。sw2是active,sw3是standby。

[quote]
sw2#sho standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Vl2 1 120 P Active local 172.16.1.3 172.16.1.1

sw3#sho standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Vl2 1 110 P Standby 172.16.1.2 local 172.16.1.1
[/quote]

二、shutdown loopback 2,HSRP切换到sw3
1、状态转换
[quote]
sw2(config)#int loopback 2
sw2(config-if)#shut
sw2(config-if)#
*Mar 1 00:04:29.403: %TRACKING-5-STATE: 1 interface Lo2 line-protocol Up->Down
*Mar 1 00:04:31.403: %LINK-5-CHANGED: Interface Loopback2, changed state to administratively down
*Mar 1 00:04:31.499: %HSRP-5-STATECHANGE: Vlan2 Grp 1 state Active -> Speak
*Mar 1 00:04:32.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to down
*Mar 1 00:04:46.495: %HSRP-5-STATECHANGE: Vlan2 Grp 1 state Speak -> Standby

[/quote]

2、HSRP切换后:
SW3接管后:
[quote]
sw3#sho standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Vl2 1 110 P Active local 172.16.1.2 172.16.1.1
[/quote]

SW2优先级降级:
[quote]
sw2#sho standby bri
P indicates configured to preempt.
|
Interface Grp Prio P State Active Standby Virtual IP
Vl2 1 90 P Standby 172.16.1.3 local 172.16.1.1

[/quote]

SW1配置:

[quote]

sw1#sho run
Building configuration…

Current configuration : 1012 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!!
!
interface FastEthernet0/0
switchport access vlan 2
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 2
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
ip address 172.16.1.88 255.255.255.0
!
ip http server
no ip http secure-server
!
!
control-plane
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

[/quote]

sw2配置:[quote]

sw2#sho run
Building configuration…

Current configuration : 1171 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
interface Loopback2
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
switchport mode trunk
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 172.16.1.2 255.255.255.0
standby 1 ip 172.16.1.1
standby 1 timers 5 15
standby 1 priority 120
standby 1 preempt
standby 1 track Loopback2 30
!
ip http server
no ip http secure-server
!
!
!
control-plane
!

!
!
line con 0
line aux 0
line vty 0 4
!
!
end

[/quote]

SW3配置:
[quote]
sw3#sho run
Building configuration…

Current configuration : 1204 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
!
!
!
interface Loopback3
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
switchport mode trunk
!
interface FastEthernet0/1
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 172.16.1.3 255.255.255.0
standby 1 ip 172.16.1.1
standby 1 timers 5 15
standby 1 priority 110
standby 1 preempt
standby 1 track Loopback3 50
!
interface Vlan3
no ip address
!
ip http server
no ip http secure-server
!
!
control-plane
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

[/quote]

发表评论

电子邮件地址不会被公开。 必填项已用*标注