思科:vrrp配置(vrrp与track配合使用)
思科:vrrp配置(vrrp与track配合使用)
sw1(config-if)#vrrp ?
<1-255> Group number
sw1(config-if)#vrrp 1 pri
sw1(config-if)#vrrp 1 priority ?
<1-254> Priority level
(1)拓扑图
sw1:
interface Vlan1
ip address 192.168.1.1 255.255.255.0
vrrp 1 ip 192.168.1.254
vrrp 1 priority 1
Vrrp 1 preempt //启用抢占模式
//在抢占模式下,如果Backup设备的优先级比当前Master设备的优先级高,则主动将自己切换成Master。
sw2:
interface Vlan1
ip address 192.168.1.2 255.255.255.0
vrrp 1 ip 192.168.1.254
vrrp 1 priority 1
Vrrp 1 preempt
sw1#show vrrp
Vlan1 - Group 1
State is Backup
Virtual IP address is 192.168.1.254
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 1
Master Router is 192.168.1.2, priority is 1
Master Advertisement interval is 1.000 sec
Master Down interval is 3.996 sec (expires in 3.294 sec)
sw1(config-if)# vrrp 1 priority 254 //优先级数值越大的越优先
sw1(config-if)#
*Aug 11 09:00:29.492: %VRRP-6-STATECHANGE: Vl1 Grp 1 state Backup -> Master
sw1(config-if)#
sw1#show vrrp
Vlan1 - Group 1
State is Master
Virtual IP address is 192.168.1.254
Virtual MAC address is 0000.5e00.0101
Advertisement interval is 1.000 sec
Preemption enabled
Priority is 254
Master Router is 192.168.1.1 (local), priority is 254
Master Advertisement interval is 1.000 sec
Master Down interval is 3.007 sec
sw1#
在测试切换时,掉一个包,如下图所示:
可以考虑将vrrp与track配合使用:
sw1:
track 1 interface GigabitEthernet0/1 line-protocol
!
track 2 interface GigabitEthernet0/0 line-protocol
!
interface Vlan1
ip address 192.168.1.1 255.255.255.0
vrrp 1 ip 192.168.1.254
vrrp 1 priority 1
Vrrp 1 preempt
vrrp 1 track 1 decrement 2 //#g0/1出现故障的时候,sw1的优先级降低60
vrrp 1 track 2 decrement 2 //#g0/0出现故障的时候,sw1的优先级降低60
sw2:
track 1 interface GigabitEthernet0/1 line-protocol
!
track 2 interface GigabitEthernet0/0 line-protocol
!
interface Vlan1
ip address 192.168.1.2 255.255.255.0
vrrp 1 ip 192.168.1.254
vrrp 1 priority 1
Vrrp 1 preempt
vrrp 1 track 1 decrement 2 //#g0/1出现故障的时候,sw1的优先级降低60
vrrp 1 track 2 decrement 2 //#g0/0出现故障的时候,sw1的优先级降低60
VRRP、HSRP(列表、list、全)vrrplist、hsrplist
http://www.zh-cjh.com/wenzhangguilei/1583.html
文章归类、所有文章列表、LISTLIST
http://www.zh-cjh.com/wangzhangonggao/2195.html
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。
转载请保留出处: www.zh-cjh.com珠海陈坚浩博客 » 思科:vrrp配置(vrrp与track配合使用)
作者: cjh
手机扫一扫,手机上查看此文章: |
一切源于价值!
其他 模板文件不存在: ./template/plugins/comment/pc/index.htm