标签:switch ethernet master system 通过 eth 组网 quit sys
虚拟路由器冗余协议(VRRP)实践
1.组网需求。
HostA需要访问 Internet上的HostB,HostA的缺省网关为10.1.1.111/24;
当SwitchA正常工作时,HostA发送给HostB的报文通过SwitchA转发;
当SwitchA出现故障时,HostA发送给HostB的报文通过SwitchB转发。
2.配置步骤
(1)配置SwitchA
<SwitchA>sys tem-view
[SwitchA]vlan 2
[SwitchA-vlan2] port gig abitethernet 1/0/11
[SwitchA-vlan2]quit
[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2]ip address 10.1.1.1 255.255.255.0
[SwitchA-Vlan-interface2]quit
[SwitchA] vlan 3
[SwitchA-vlan3] port gigabitethernet 1/0/13
[SwitchA-vlan3] quit
[S witchA] interface vlan-interface 3
[SwitchA-Vlan-interface3]ip address 10.1.3.1 255.255.255.0
[SwitchA-Vlan-interface3jquit
[S witchA]ip route-static 0.0.0.0 0 10.1.3.2
创建备份组1,并配置备份组1的拟IP地址为10.1.1.111。
[SwitchA]inter vlan 2
[S witchA-Vlan-interface2]vrrp vrid 1 virtual-ip 10.1.1.111
设置SwitchA在备份组1中的优先级为110,高于Switch B的优先级100,以保证Switch A成为Master负责转发流量。
[SwitchA-Vlan-interface2]vrrp vrid 1 priority 110
设置SwitchA工作在抢占方式,以保证SwitchA故障恢复后,能再次抢占成为Master,即只要Switch A正常工作,就由SwitchA负责转发流量。为了连免频繁地进行状态切换,配置抢占延迟时间为5秒。
[SwitchA-Vlan-interface2]vrrp vrid 1 preempt-mode delay 500
(2)配置Switch B
<SwitchB>system-view
[SwitchB]vlan 2
[SwitchB-Vlan2]port gigabitethernet 1/0/12
[Switch B-vlan2]quit
[Switch B]interface vlan-interface 2
[SwitchB-Vlan-interface2]ip address 10.1.1.2 255.255.255.0
[Switch B-Vlan-interface2]quit
[Switch B]vlan 3
[Switch B-vlan3]port gig abitethernet 1/0/14
[Switch B-vlan3]quit
[Switch B]interface vlan-interface 3
[Switch B-Vlan-interface3]ip address 10.1.4.1 255.255.255.0
[Switch B-Vlan-interface3]quit
[SwitchB]ip route-static 0.0.0.0 010.14.2
创建备份组1,并配置备份组1的拟IP地址为10.1.1.111。
[Switch B]interface vlan-interface 2
[SwitchB-Vlan-interface2]vrrp vrid 1 virtual-ip 10.1.1.111
设置Switch B在备份组1中的优先级为100。
[Switch B-Vlan-interface2]vrrp vrid 1 priority 100
设置Switch B工作在抢占方式,抢占延迟时间为5秒。
[SwitchB-Vlan-interface2]vrrp vrid 1 preempt-mode delay 500
(3)配置SwitchC
<SwitchC>system-view
[SwitchC]inter g 1/0/13
[SwitchC-Gig abitE thernet1/0/13]port link-mode route
[SwitchC-Gig abitE thernet1/0/13]ip add 10.1.3.224
[SwitchC-Gig ab itE thernet1/0/13]undo shut
[SwitchC-Gig abitE thernet1/0/13]quit
[SwitchC]inter g 1/0/14
[SwitchC-Gig ab itE thernet1/0/14lport link-mode route
[SwitchC-Gig abitE thernet1/0/14]ip add 10.1.4.224
[S witchC-Gig abitE thernet1/0/14]undo shut
[SwitchC-Gig abitE thernet1/0/14]quit
[SwitchC]vlan 2
[SwitchC-Vlan2]port gigabitethernet 1/0/1
[SwitchC-vlan2]quit
[SwitchC]interface vlan-interface2
[SwitchC-Vlan-interface2]ip address 10.1.2.2 255.255.255.0
[SwitchC-Vlan-interface2]quit
[SwitchC]ip route 10.1.1.0 24 10.1.3.1
[SwitchC]ip route 10.1.1.0 24 10.1.4.1
3.验证配置
置完成后,在HostA上可以ping通 HostB。
通过dis play vrrp verbose命令查看配置后的结果。
显示SwitchA上备份组1的详细信息。
标签:switch ethernet master system 通过 eth 组网 quit sys
原文地址:https://blog.51cto.com/14223834/2415099