思科HSRP配置實例


實例如下圖示:

HSRP
默認每3秒種發送一個hello消息。
standby <number> timers <間隔時間> <沒收到的間隔時間切換>
如:
standby 39 timers 5 15 定義39組5秒交換一次hello信息,如15秒內沒收到hello信息將開始切換。
config t
track <track-number> interface <interface-name> line-protocol
int vlan<number>
 standby <number> track <track-number>
如:
config t
track 1 interface FastEthernet0/1 line-protocol
int vlan39
 standby 39 track 1

完整配置命令如下:
R1:
interface FastEthernet0/0
 ip address 12.1.1.1 255.255.255.0
 no sh
interface FastEthernet0/1
 ip address 13.1.1.1 255.255.255.0
 no sh
router rip
 version 2
 network 12.0.0.0
 network 13.0.0.0

CoreSW1:
vlan database
 vlan38
 vlan39
config t
interface Port-channel1
 switchport mode trunk
 no sh
int range f1/14 - 15
 switch mode trunk 
 duplex full 
 speed 1000
 channel-group 1 mode on
 no sh
interface FastEthernet0/0
 ip address 12.1.1.2 255.255.255.0
 no sh
track 1 interface FastEthernet0/0 line-protocol
track 2 interface Port-channel1 line-protocol
int vlan38
 ip add 10.38.38.251 255.255.255.0
 ip helper-address 10.39.39.39
 standby 38 ip 10.38.38.254
 standby 38 timers 5 15
 standby 38 priority 130
 standby 38 preempt
 standby 38 track 1
 standby 38 track 2
int vlan39
 ip address 10.39.39.251 255.255.255.0
 ip helper-address 10.39.39.39
 standby 39 ip 10.39.39.254
 standby 39 timers 5 15
 standby 39 priority 150
 standby 39 preempt
 standby 39 track 1
 standby 39 track 2
router rip 
 version 2
 network 10.0.0.0
 network 12.0.0.0
int f1/0  //接PC1
 switch port access vlan 38
 duplex full 
 speed 1000

CoreSW2:
vlan database
 vlan38
 vlan39
config t
interface Port-channel1
 switchport mode trunk
 no sh
int range f1/14 - 15
 switch mode trunk 
 duplex full 
 speed 1000
 channel-group 1 mode on
 no sh
interface FastEthernet0/1
 ip address 13.1.1.3 255.255.255.0
 no sh
track 1 interface FastEthernet0/1 line-protocol
track 2 interface Port-channel1 line-protocol
int vlan38
 ip add 10.38.38.252 255.255.255.0
 ip helper-address 10.39.39.39
 standby 38 ip 10.38.38.254
 standby 38 timers 5 15
 standby 38 priority 150
 standby 38 preempt
 standby 38 track 1
 standby 38 track 2
int vlan39
 ip address 10.39.39.252 255.255.255.0
 ip helper-address 10.39.39.39
 standby 39 ip 10.39.39.254
 standby 39 timers 5 15
 standby 39 priority 130
 standby 39 preempt
 standby 39 track 1
 standby 39 track 2
router rip 
 version 2
 network 10.0.0.0
 network 13.0.0.0
int f1/0  //接PC2
 switch port access vlan 39
 duplex full 
 speed 1000 


PC1:
ip 10.38.38.1 255.255.255.0 10.38.38.254

PC2:
ip 10.39.39.2 255.255.255.0 10.39.39.254

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM