华为eNSP实验:VRRP协议双组双备实验
程序员文章站
2024-03-12 15:07:20
...
一、实验环境
eNSP V100R003C00SPC100版本
二、实验拓扑
三、实验需求
1,LSW2为192.168.10.0/24网段的主路由,192.168.20.0/24网段的备用路由
2,LSW3为192.168.20.0/24网段的主路由,192.168.10.0/24网段的备用路由
3,当断掉某个网段的主路由时,通过vrrp协议备用路由自动启用。
四、实验步骤
配置PC1,PC2,SW1,SW2,SW3-------在R1上配置回环地址测试---------验证需求
PC1设置
PC2设置
SW1交换机设置
[sw1]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[sw1]vlan b 10 20 ##添加vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]int e0/0/1 ###将接口加入vlan
[sw1-Ethernet0/0/1]p l a
[sw1-Ethernet0/0/1]p d v 10
[sw1-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]p l a
[sw1-Ethernet0/0/2]p d v 20
[sw1-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[sw1-Ethernet0/0/2]int g0/0/1
[sw1-GigabitEthernet0/0/1]p l t
[sw1-GigabitEthernet0/0/1]p t a v 10 20
[sw1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[sw1-GigabitEthernet0/0/1]int g0/0/2
[sw1-GigabitEthernet0/0/2]p l t
[sw1-GigabitEthernet0/0/2]p t a v 10 20
[sw1-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
SW2三层交换机配置
[SW2]vlan b 10 20 100 ###添加vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2-GigabitEthernet0/0/2]p l a ##将接口加入vlan
[SW2-GigabitEthernet0/0/2]p d v 100
[SW2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l t
[SW2-GigabitEthernet0/0/1]p t a v 10 20
[SW2-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[SW2-GigabitEthernet0/0/1]int vlanif 10 ##配置虚拟接口
[SW2-Vlanif10]ip add 192.168.10.10 24
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 ##配置vrrp协议
[SW2-Vlanif10]vrrp vrid 1 pr
[SW2-Vlanif10]vrrp vrid 1 priority 120 ##192.168.10.0网段优先级
[SW2-Vlanif10]vrrp vrid 1 track interface g0/0/2
[SW2-Vlanif10]int vlanif20
[SW2-Vlanif20]ip add 192.168.20.10 24
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 2 priority 115 ##192.168.20.0网段优先级
[SW2-Vlanif20]int vlanif100
[SW2-Vlanif100]ip add 11.0.0.1 30 ###配置默认路由出去
[SW2]ip route-static 0.0.0.0 0.0.0.0 11.0.0.2
SW3三层交换机配置
[SW3]undo info-center enable ##关闭华为信息提示
Info: Information center is disabled.
[SW3]vlan b 10 20 100 ##添加vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]int g0/0/1 ###将接口加入vlan
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 100
[SW3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[SW3]int g0/0/2
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/2]p t a v 10 20
[SW3-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[SW3-GigabitEthernet0/0/2]int vlanif 10 ###配置虚拟接口
[SW3-Vlanif10]ip add 192.168.10.20 24
[SW3-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 ##配置vrrp协议
[SW3-Vlanif10]vrrp v 1 priority 115 ##192.168.10.0网段优先级
[SW3-Vlanif10]int vlanif 20
[SW3-Vlanif20]ip add 192.168.20.20 24
[SW3-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1 ##192.168.20.0网段优先级
[SW3-Vlanif20]vrrp vrid 2 priority 120
[SW3-Vlanif20]vrrp vrid 2 track interface g0/0/1
[SW3-Vlanif20]int vlanif 100
[SW3-Vlanif100]ip add 12.0.0.1 30
[SW3-Vlanif100]q ###配置默认路由出去
[SW3]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
R1配置
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.2 30
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]un sh
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.2 30
[R1-GigabitEthernet0/0/1]un sh
[R1-GigabitEthernet0/0/1]q
[R1]ip route-static 192.168.10.0 24 11.0.0.1 ##配置浮动路由
[R1]ip route-static 192.168.20.0 24 11.0.0.1 preference 70
[R1]ip route-static 192.168.20.0 24 12.0.0.1
[R1]ip route-static 192.168.10.0 24 12.0.0.1 preference 70
[R1]int loo 0 ###配置环回地址用于测试
[R1-LoopBack0]ip add 1.1.1.1 32
五、验证需求
1,sw2为192.168.10.0/24网段主路由,sw3为192.168.10.0/24网段备用路由
用PC1ping测试地址1.1.1.1
分别抓包2台三层交换机的上层口,发现数据在SW2主路由通讯
左边为SW2上层口,右边为SW3上层口。
2,当断开SW2的上层口时,备用路由SW3会总动变为主路由。SW2变为备用路由。
分别抓包2台三层交换机的上层口,发现此时数据在原备用路由SW3通讯;
左边为SW2上层口,右边为SW3上层口;
左边此时是静止的,已断开,数据在右边通讯。
上一篇: SpringBoot之模板引擎
下一篇: 探讨Java语言中那些修饰符