1、华为交换机VRRP配置图3-128配置VRRP主备备份组网图配置思路采用VRRP主备备份实现网关冗余备份,配置思路如下:1.配置各设备接口IP地址与路由协议,使各设备间网络层连通。2.在SwitchA和SwitchB上配置VRRP备份组。其中,SwitchA上配置较高优先级和20秒抢占延时,作为Master设备承担流量转发;SwitchB上配置较低优先级,作为备用交换机,实现网关冗余备份。操作步骤1.配置设备间的网络互连# 配置设备各接口的IP地址,以SwitchA为例。SwitchB和SwitchC的配置与SwitchA类似,详见配置文件。 system-viewHUAWEI sysname
2、 SwitchASwitchA vlan batch 100 300SwitchA interface gigabitethernet 1/0/1SwitchA-GigabitEthernet1/0/1 port link-type hybridSwitchA-GigabitEthernet1/0/1 port hybrid pvid vlan 300SwitchA-GigabitEthernet1/0/1 port hybrid untagged vlan 300SwitchA-GigabitEthernet1/0/1 quitSwitchA interface gigabitetherne
3、t 1/0/2SwitchA-GigabitEthernet1/0/2 port link-type hybridSwitchA-GigabitEthernet1/0/2 port hybrid pvid vlan 100SwitchA-GigabitEthernet1/0/2 port hybrid untagged vlan 100SwitchA-GigabitEthernet1/0/2 quitSwitchA interface vlanif 100SwitchA-Vlanif100 ip address 10.1.1.1 24SwitchA-Vlanif100 quitSwitchA
4、interface vlanif 300SwitchA-Vlanif300 ip address 192.168.1.1 24SwitchA-Vlanif300 quit# 配置Switch的二层转发功能。 system-viewHUAWEI sysname SwitchSwitch vlan 100Switch-vlan100 quitSwitch interface gigabitethernet 1/0/1Switch-GigabitEthernet1/0/1 port link-type hybridSwitch-GigabitEthernet1/0/1 port hybrid pvi
5、d vlan 100Switch-GigabitEthernet1/0/1 port hybrid untagged vlan 100Switch-GigabitEthernet1/0/1 quitSwitch interface gigabitethernet 1/0/2Switch-GigabitEthernet1/0/2 port link-type hybridSwitch-GigabitEthernet1/0/2 port hybrid pvid vlan 100Switch-GigabitEthernet1/0/2 port hybrid untagged vlan 100Swit
6、ch-GigabitEthernet1/0/2 quit# 配置SwitchA、SwitchB和SwitchC间采用OSPF协议进行互连。以SwitchA为例,SwitchB和SwitchC的配置与SwitchA类似,详见配置文件。SwitchA ospf 1SwitchA-ospf-1 area 0SwitchA-ospf-1-area-0.0.0.0 SwitchA-ospf-1-area-0.0.0.0 SwitchA-ospf-1-area-0.0.0.0 quitSwitchA-ospf-1 quit2.配置VRRP备份组# 在SwitchA上创建VRRP备份组1,配置SwitchA
7、在该备份组中的优先级为120,并配置抢占时间为20秒。SwitchA interface vlanif 100SwitchA-Vlanif100 SwitchA-Vlanif100 vrrp vrid 1 priority 120 /设备在VRRP备份组中的优先级缺省为100,修改Master设备的优先级大于Backup设备SwitchA-Vlanif100 vrrp vrid 1 preempt-mode timer delay 20 /设备在VRRP备份组中缺省采用立即抢占方式。修改Master设备的延迟抢占时间,以避免在网络环境不稳定时,由于双方频繁抢占而导致流量中断的问题SwitchA
8、-Vlanif100 quit# 在SwitchB上创建VRRP备份组1,其在该备份组中的优先级采用缺省值100(不需要配置)。SwitchB interface vlanif 100SwitchB-Vlanif100 SwitchB-Vlanif100 quit3.验证配置结果# 完成上述配置以后,在SwitchA和SwitchB上分别执行display vrrp命令,可以看到SwitchA在备份组中的状态为Master,SwitchB在备份组中的状态为Backup。SwitchA display vrrp Vlanif100 | Virtual Router 1State : Master
9、 PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 20 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forward : disabled Create time : 2012-01-12 20:15:46 Last change time : 2012-01
10、-12 20:15:46SwitchB display vrrp Vlanif100 | Virtual Router 1State : Backup PriorityRun : 100 PriorityConfig : 100 MasterPriority : 120 Preempt : YES Delay Time : 0 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forwa
11、rd : disabled Create time : 2012-01-12 20:15:46 Last change time : 2012-01-12 20:15:46# 在SwitchA和SwitchB上执行display ip routing-table命令,SwitchA上可以看到路由表中有一条目的地址为虚拟IP地址的直连路由,而SwitchB上该路由为OSPF路由。SwitchA和SwitchB上的显示信息如下。SwitchA display ip routing-tableRoute Flags: R - relay, D - download to fib- Routing T
12、ables: Public Destinations : 9 Routes : 10 Destination/Mask Proto Pre Cost Flags NextHop Interface Direct00DVlanif100 OSPF 10 2 D 192.168.1.2 Vlanif300SwitchB display ip routing-tableRoute Flags: R - relay, D - download to fib- Routing Tables: Public Destinations : 9 Routes : 10 Destination/Mask Pro
13、to Pre Cost Flags NextHop Interface OSPF102DVlanif100 OSPF 10 2 D 192.168.2.2 Vlanif200 19# 在SwitchA的接口GE1/0/2上执行shutdown命令,模拟SwitchA出现故障。SwitchA interface gigabitethernet 1/0/2SwitchA-GigabitEthernet1/0/2 shutdownSwitchA-GigabitEthernet1/0/2 quit# 在SwitchB上执行display vrrp命令查看VRRP状态信息,可以看到SwitchB的状态是
14、Master。SwitchB display vrrp Vlanif100 | Virtual Router 1State : Master PriorityRun : 100 PriorityConfig : 100 MasterPriority : 100 Preempt : YES Delay Time : 0 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forward :
15、disabled Create time : 2012-01-12 20:15:46 Last change time : 2012-01-12 20:18:40# 在SwitchA的接口GE1/0/2上执行undo shutdown命令。SwitchA interface gigabitethernet 1/0/2SwitchA-GigabitEthernet1/0/2 undo shutdownSwitchA-GigabitEthernet1/0/2 quit# 等待20秒后,在SwitchA上执行display vrrp命令查看VRRP状态信息,可以看到SwitchA的状态恢复成Mast
16、er。SwitchA display vrrp Vlanif100 | Virtual Router 1State : Master PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 20 s TimerRun : 1 s TimerConfig : 1 s Auth type : NONE Virtual MAC : 0000-5e00-0101 Check TTL : YES Config type : normal-vrrp Backup-forward : dis
17、abled Create time : 2012-01-12 20:15:46 Last change time : 2012-01-12 20:20:56配置文件SwitchA的配置文件#sysname SwitchA#vlan batch 100 300#interface Vlanif100 vrrp vri vrrp vrid 1 priority 120 vrrp vrid 1 preempt-mode timer delay 20#interface Vlanif300#interface GigabitEthernet1/0/1 port link-type hybrid por
18、t hybrid pvid vlan 300 port hybrid untagged vlan 300#interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100#ospf 1#returnSwitchB的配置文件#sysname SwitchB#vlan batch 100 200#interface Vlanif100#interface Vlanif200#interface GigabitEthernet1/0/1 port l
19、ink-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200#interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100#ospf 1#returnSwitchC的配置文件#sysname SwitchC#vlan batch 200 300 400#interface Vlanif200#interface Vlanif300#interface Vlan
20、if400#interface GigabitEthernet1/0/1 port link-type hybrid port hybrid pvid vlan 300 port hybrid untagged vlan 300#interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 200 port hybrid untagged vlan 200#interface GigabitEthernet1/0/3 port link-type hybrid port hybrid pvid vlan 4
21、00 port hybrid untagged vlan 400#ospf 1#returnSwitch的配置文件#sysname Switch#vlan batch 100#interface GigabitEthernet1/0/1 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100#interface GigabitEthernet1/0/2 port link-type hybrid port hybrid pvid vlan 100 port hybrid untagged vlan 100#return
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1