使用ensp模拟器中的三层交换机配置vrrp(基于vlan的)

使用ensp模拟器中的三层交换机配置vrrp

关于vrrp的介绍、相关术语、状态及使用路由器配置vrrp请参考:

使用ensp模拟器中的路由器配置vrrp详解

这次只讲解使用三层交换机配置vrrp

拓扑图

在这里插入图片描述

配置

电脑终端:
如图配置好相应的ip地址、子网掩码和网关。

LSW1:
[lsw1]vlan batch 10 20
[lsw1]interface Ethernet0/0/1
[lsw1-Ethernet0/0/1]port link-type access
[lsw1-Ethernet0/0/1]port default vlan 10
[lsw1-Ethernet0/0/1]quit
[lsw1]interface Ethernet0/0/2
[lsw1-Ethernet0/0/2]port link-type access
[lsw1-Ethernet0/0/2]port default vlan 20
[lsw1-Ethernet0/0/2]quit
[lsw1]interface Ethernet0/0/3
[lsw1-Ethernet0/0/3]port link-type trunk
[lsw1-Ethernet0/0/3]port trunk allow-pass vlan 10 20
[lsw1-Ethernet0/0/3]quit
[lsw1]quit
save

LSW2:
[lsw2]vlan batch 30 40
[lsw2]interface Ethernet0/0/1
[lsw2-Ethernet0/0/1]port link-type access
[lsw2-Ethernet0/0/1]port default vlan 30
[lsw2-Ethernet0/0/1]quit
[lsw2]interface Ethernet0/0/2
[lsw2-Ethernet0/0/2]port link-type access
[lsw2-Ethernet0/0/2]port default vlan 40
[lsw2-Ethernet0/0/2]quit
[lsw2]interface Ethernet0/0/3
[lsw2-Ethernet0/0/3]port link-type trunk
[lsw2-Ethernet0/0/3]port trunk allow-pass vlan 30 40
[lsw2-Ethernet0/0/3]quit
[lsw2]quit
save

LSW3:
[lsw3]vlan batch 10 20 30 40
[lsw3]interface GigabitEthernet 0/0/1
[lsw3-GigabitEthernet0/0/1]port link-type trunk
[lsw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[lsw3-GigabitEthernet0/0/1]quit
[lsw3]interface GigabitEthernet 0/0/2
[lsw3-GigabitEthernet0/0/2]port link-type trunk
[lsw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[lsw3-GigabitEthernet0/0/2]quit
[lsw3]interface Vlanif 10
[lsw3-Vlanif10]ip address 192.168.10.252 255.255.255.0
[lsw3-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[lsw3-Vlanif10]quit
[lsw3]interface Vlanif 20
[lsw3-Vlanif20]ip address 192.168.20.252 255.255.255.0
[lsw3-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[lsw3-Vlanif20]quit
[lsw3]interface Vlanif 30
[lsw3-Vlanif30]ip address 192.168.30.252 255.255.255.0
[lsw3-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254
[lsw3-Vlanif30]quit
[lsw3]interface Vlanif 40
[lsw3-Vlanif40]ip address 192.168.40.252 255.255.255.0
[lsw3-Vlanif40]vrrp vrid 40 virtual-ip 192.168.40.254
[lsw3-Vlanif40]quit
[lsw3]quit
save

LSW4:
[lsw4]vlan batch 10 20 30 40
[lsw4]interface GigabitEthernet 0/0/1
[lsw4-GigabitEthernet0/0/1]port link-type trunk
[lsw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 30 40
[lsw4-GigabitEthernet0/0/1]quit
[lsw4]interface GigabitEthernet 0/0/2
[lsw4-GigabitEthernet0/0/2]port link-type trunk
[lsw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[lsw4-GigabitEthernet0/0/2]quit
[lsw4]interface Vlanif 10
[lsw4-Vlanif10]ip address 192.168.10.253 255.255.255.0
[lsw4-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[lsw4-Vlanif10]quit
[lsw4]interface Vlanif 20
[lsw4-Vlanif20]ip address 192.168.20.253 255.255.255.0
[lsw4-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[lsw4-Vlanif20]quit
[lsw4]interface Vlanif 30
[lsw4-Vlanif30]ip address 192.168.30.253 255.255.255.0
[lsw4-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254
[lsw4-Vlanif30]quit
[lsw4]interface Vlanif 40
[lsw4-Vlanif40]ip address 192.168.40.253 255.255.255.0
[lsw4-Vlanif40]vrrp vrid 40 virtual-ip 192.168.40.254
[lsw4-Vlanif40]quit
[lsw4]quit
save

验证

分别查看两个三层交换机上的vrrp状态,并随机找几台电脑终端进行互ping,并查看路径信息。(使用tracert命令)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

发布了14 篇原创文章 · 获赞 24 · 访问量 2072

猜你喜欢

转载自blog.csdn.net/weixin_43996007/article/details/103897117