HSRP的基本配置

HSRP的基本配置
R2(config-if)#do sh ru
Building configuration...
 
Current configuration : 1288 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R2
!
!
ip subnet-zero
ip cef
!
!
no ip domain-lookup
!
ip audit notify log
ip audit po max-events 100
ip ssh time-out 120
ip ssh authentication-retries 3
!
!
!         
!
!
!
!
interface FastEthernet0/0
  ip address 192.168.0.1 255.255.255.0   
 no ip redirects
 duplex half
 standby 1 ip 192.168.0.5             // 设置虚拟路由组号,组号必需一样
 standby 1 priority 110              // 设置优先组,默认为100 ,优先级越大越好
 standby 1 preempt                 // 配置HRSP 的抢占
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 ip address 172.16.0.3 255.255.255.0
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!         
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router rip
 version 2
 network 172.16.0.0
 network 192.168.0.0
!
ip classless
no ip http server
no ip http secure-server
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 5 15
!
!
End
 
 
 
 
 
 
 
R3(config-if)#do sh ru
Building configuration...
 
Current configuration : 1281 bytes
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R3
!
!
ip subnet-zero
ip cef
!
!
no ip domain-lookup
!
ip audit notify log
ip audit po max-events 100
ip ssh time-out 120
ip ssh authentication-retries 3
!
!
!         
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.0.2 255.255.255.0
 no ip redirects
 duplex half
 standby 1 ip 192.168.0.5             // R2 的虚拟路由组号必需一样
 standby 1 track FastEthernet0/0 20   // 配置接口跟踪,如果接口DOWN 的话优先级减20
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 ip address 172.16.0.4 255.255.255.0
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router rip
 version 2
 network 172.16.0.0
 network 192.168.0.0
!
ip classless
no ip http server
no ip http secure-server
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 5 15
!
!
End
 
为了测试配置结果,当把R2DOWN的时候R3自动转成了Active状态,当R2UP后因为R2配了抢占,而且R2的优先级要高于R3,R2又抢占回Active状态。而R3又回到了Speak状态。
R2(config-if)#sh
01:13:48: %STANDBY-5-STATECHANGE: FastEthernet0/0 Group 1 state Active -> Init
 
R3#      
01:09:26: %STANDBY-5-STATECHANGE: FastEthernet0/0 Group 1 state Standby -> Active
 
 
R2(config-if)#
01:18:08: %STANDBY-5-STATECHANGE: FastEthernet0/0 Group 1 state Listen -> Active
 
R3#
01:13:29: %STANDBY-5-STATECHANGE: FastEthernet0/0 Group 1 state Active -> Speak
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值