华为交换机VRRP配置.docx
- 文档编号:11819623
- 上传时间:2023-04-03
- 格式:DOCX
- 页数:11
- 大小:46.21KB
华为交换机VRRP配置.docx
《华为交换机VRRP配置.docx》由会员分享,可在线阅读,更多相关《华为交换机VRRP配置.docx(11页珍藏版)》请在冰豆网上搜索。
华为交换机VRRP配置
图3-128?
?
配置VRRP主备备份组网图?
配置思路
采用VRRP主备备份实现网关冗余备份,配置思路如下:
1.配置各设备接口IP地址及路由协议,使各设备间网络层连通。
2.在SwitchA和SwitchB上配置VRRP备份组。
其中,SwitchA上配置较高优先级和20秒抢占延时,作为Master设备承担流量转发;SwitchB上配置较低优先级,作为备用交换机,实现网关冗余备份。
操作步骤
1.配置设备间的网络互连
#配置设备各接口的IP地址,以SwitchA为例。
SwitchB和SwitchC的配置与SwitchA类似,详见配置文件。
[HUAWEI]sysnameSwitchA
[SwitchA]vlanbatch100300
[SwitchA]interfacegigabitethernet1/0/1
[SwitchA-GigabitEthernet1/0/1]portlink-typehybrid
[SwitchA-GigabitEthernet1/0/1]porthybridpvidvlan300
[SwitchA-GigabitEthernet1/0/1]porthybriduntaggedvlan300
[SwitchA-GigabitEthernet1/0/1]quit
[SwitchA]interfacegigabitethernet1/0/2
[SwitchA-GigabitEthernet1/0/2]portlink-typehybrid
[SwitchA-GigabitEthernet1/0/2]porthybridpvidvlan100
[SwitchA-GigabitEthernet1/0/2]porthybriduntaggedvlan100
[SwitchA-GigabitEthernet1/0/2]quit
[SwitchA]interfacevlanif100
[SwitchA-Vlanif100]ipaddress24
[SwitchA-Vlanif100]quit
[SwitchA]interfacevlanif300
[SwitchA-Vlanif300]ipaddress24
[SwitchA-Vlanif300]quit
#配置Switch的二层转发功能。
[HUAWEI]sysnameSwitch
[Switch]vlan100
[Switch-vlan100]quit
[Switch]interfacegigabitethernet1/0/1
[Switch-GigabitEthernet1/0/1]portlink-typehybrid
[Switch-GigabitEthernet1/0/1]porthybridpvidvlan100
[Switch-GigabitEthernet1/0/1]porthybriduntaggedvlan100
[Switch-GigabitEthernet1/0/1]quit
[Switch]interfacegigabitethernet1/0/2
[Switch-GigabitEthernet1/0/2]portlink-typehybrid
[Switch-GigabitEthernet1/0/2]porthybridpvidvlan100
[Switch-GigabitEthernet1/0/2]porthybriduntaggedvlan100
[Switch-GigabitEthernet1/0/2]quit
#配置SwitchA、SwitchB和SwitchC间采用OSPF协议进行互连。
以SwitchA为例,SwitchB和SwitchC的配置与SwitchA类似,详见配置文件。
[SwitchA]ospf1
[SwitchA-ospf-1]area0
[SwitchA-ospf-1-area-]network
[SwitchA-ospf-1-area-]network
[SwitchA-ospf-1-area-]quit
[SwitchA-ospf-1]quit
2.配置VRRP备份组
#在SwitchA上创建VRRP备份组1,配置SwitchA在该备份组中的优先级为120,并配置抢占时间为20秒。
[SwitchA]interfacevlanif100
[SwitchA-Vlanif100]vrrpvrid1virtual-ip
[SwitchA-Vlanif100]vrrpvrid1priority120//设备在VRRP备份组中的优先级缺省为100,修改Master设备的优先级大于Backup设备
[SwitchA-Vlanif100]vrrpvrid1preempt-modetimerdelay20//设备在VRRP备份组中缺省采用立即抢占方式。
修改Master设备的延迟抢占时间,以避免在网络环境不稳定时,由于双方频繁抢占而导致流量中断的问题
[SwitchA-Vlanif100]quit
#在SwitchB上创建VRRP备份组1,其在该备份组中的优先级采用缺省值100(不需要配置)。
[SwitchB]interfacevlanif100
[SwitchB-Vlanif100]vrrpvrid1virtual-ip
[SwitchB-Vlanif100]quit
3.验证配置结果
#完成上述配置以后,在SwitchA和SwitchB上分别执行displayvrrp命令,可以看到SwitchA在备份组中的状态为Master,SwitchB在备份组中的状态为Backup。
[SwitchA]displayvrrp
Vlanif100|VirtualRouter1
State:
Master
VirtualIP:
MasterIP:
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
120
Preempt:
YESDelayTime:
20s
TimerRun:
1s
TimerConfig:
1s
Authtype:
NONE
VirtualMAC:
0000-5e00-0101
CheckTTL:
YES
Configtype:
normal-vrrp
Backup-forward:
disabled
Createtime:
2012-01-1220:
15:
46
Lastchangetime:
2012-01-1220:
15:
46
[SwitchB]displayvrrp
Vlanif100|VirtualRouter1
State:
Backup
VirtualIP:
MasterIP:
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
120
Preempt:
YESDelayTime:
0s
TimerRun:
1s
TimerConfig:
1s
Authtype:
NONE
VirtualMAC:
0000-5e00-0101
CheckTTL:
YES
Configtype:
normal-vrrp
Backup-forward:
disabled
Createtime:
2012-01-1220:
15:
46
Lastchangetime:
2012-01-1220:
15:
46
#在SwitchA和SwitchB上执行displayiprouting-table命令,SwitchA上可以看到路由表中有一条目的地址为虚拟IP地址的直连路由,而SwitchB上该路由为OSPF路由。
SwitchA和SwitchB上的显示信息如下。
[SwitchA]displayiprouting-table
RouteFlags:
R-relay,D-downloadtofib
------------------------------------------------------------------------------
RoutingTables:
Public
Destinations:
9Routes:
10
Destination/MaskProtoPreCostFlagsNextHopInterface
/24Direct00DVlanif100
/32Direct00DVlanif100
/32Direct00DVlanif100
/8Direct00DInLoopBack0
/32Direct00DInLoopBack0
/24OSPF102DVlanif300
/24Direct00DVlanif300
/32Direct00DVlanif300
/24OSPF102DVlanif100
OSPF102DVlanif300
[SwitchB]displayiprouting-table
RouteFlags:
R-relay,D-downloadtofib
------------------------------------------------------------------------------
RoutingTables:
Public
Destinations:
9Routes:
10
Destination/MaskProtoPreCostFlagsNextHopInterface
/24Direct00DVlanif100
/32Direct00DVlanif100
/32OSPF102DVlanif100
/8Direct00DInLoopBack0
/32Direct00DInLoopBack0
/24OSPF102DVlanif200
/24OSPF102DVlanif100
OSPF102DVlanif200
/24Direct00DVlanif200
/32Direct00DVlanif200
#在SwitchA的接口GE1/0/2上执行shutdown命令,模拟SwitchA出现故障。
[SwitchA]interfacegigabitethernet1/0/2
[SwitchA-GigabitEthernet1/0/2]shutdown
[SwitchA-GigabitEthernet1/0/2]quit
#在SwitchB上执行displayvrrp命令查看VRRP状态信息,可以看到SwitchB的状态是Master。
[SwitchB]displayvrrp
Vlanif100|VirtualRouter1
State:
Master
VirtualIP:
MasterIP:
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
100
Preempt:
YESDelayTime:
0s
TimerRun:
1s
TimerConfig:
1s
Authtype:
NONE
VirtualMAC:
0000-5e00-0101
CheckTTL:
YES
Configtype:
normal-vrrp
Backup-forward:
disabled
Createtime:
2012-01-1220:
15:
46
Lastchangetime:
2012-01-1220:
18:
40
#在SwitchA的接口GE1/0/2上执行undoshutdown命令。
[SwitchA]interfacegigabitethernet1/0/2
[SwitchA-GigabitEthernet1/0/2]undoshutdown
[SwitchA-GigabitEthernet1/0/2]quit
#等待20秒后,在SwitchA上执行displayvrrp命令查看VRRP状态信息,可以看到SwitchA的状态恢复成Master。
[SwitchA]displayvrrp
Vlanif100|VirtualRouter1
State:
Master
VirtualIP:
MasterIP:
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
120
Preempt:
YESDelayTime:
20s
TimerRun:
1s
TimerConfig:
1s
Authtype:
NONE
VirtualMAC:
0000-5e00-0101
CheckTTL:
YES
Configtype:
normal-vrrp
Backup-forward:
disabled
Createtime:
2012-01-1220:
15:
46
Lastchangetime:
2012-01-1220:
20:
56
配置文件
SwitchA的配置文件
#
sysnameSwitchA
#
vlanbatch100300
#
interfaceVlanif100
ipaddress
vrrpvrid1virtual-ip
vrrpvrid1priority120
vrrpvrid1preempt-modetimerdelay20
#
interfaceVlanif300
ipaddress
#
interfaceGigabitEthernet1/0/1
portlink-typehybrid
porthybridpvidvlan300
porthybriduntaggedvlan300
#
interfaceGigabitEthernet1/0/2
portlink-typehybrid
porthybridpvidvlan100
porthybriduntaggedvlan100
#
ospf1
area
network
network
#
return
SwitchB的配置文件
#
sysnameSwitchB
#
vlanbatch100200
#
interfaceVlanif100
ipaddress
vrrpvrid1virtual-ip
#
interfaceVlanif200
ipaddress
#
interfaceGigabitEthernet1/0/1
portlink-typehybrid
porthybridpvidvlan200
porthybriduntaggedvlan200
#
interfaceGigabitEthernet1/0/2
portlink-typehybrid
porthybridpvidvlan100
porthybriduntaggedvlan100
#
ospf1
area
network
network
#
return
SwitchC的配置文件
#
sysnameSwitchC
#
vlanbatch200300400
#
interfaceVlanif200
ipaddress
#
interfaceVlanif300
ipaddress
#
interfaceVlanif400
ipaddress
#
interfaceGigabitEthernet1/0/1
portlink-typehybrid
porthybridpvidvlan300
porthybriduntaggedvlan300
#
interfaceGigabitEthernet1/0/2
portlink-typehybrid
porthybridpvidvlan200
porthybriduntaggedvlan200
#
interfaceGigabitEthernet1/0/3
portlink-typehybrid
porthybridpvidvlan400
porthybriduntaggedvlan400
#
ospf1
area
network
network
network
#
return
Switch的配置文件
#
sysnameSwitch
#
vlanbatch100
#
interfaceGigabitEthernet1/0/1
portlink-typehybrid
porthybridpvidvlan100
porthybriduntaggedvlan100
#
interfaceGigabitEthernet1/0/2
portlink-typehybrid
porthybridpvidvlan100
porthybriduntaggedvlan100
#
return
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 华为 交换机 VRRP 配置
![提示](https://static.bdocx.com/images/bang_tan.gif)