使用ensp搭建简单校园网拓扑

使用ensp搭建简单校园网拓扑

一、校园网拓扑

在这里插入图片描述
1、每台电脑代表一个vlan
2、二层交换机向下的每个端口需要做access;向上的每个端口需要做trunk
3、三层交换机向下的每个端口需要做trunk;而且需要为每个vlan接口配置ip地址,才能起到“路由”的作用。
(二层交换机只有转发的功能;三层交换机既可以转发也可以路由)

二、配置

1、为每台电脑配置相应的ip地址、子网掩码、网关
在这里插入图片描述
2、配置二层交换机

[lsw1]sysname 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

[Huawei]sysname 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

3、配置三层交换机

[Huawei]sysname 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 30 40
[lsw3-GigabitEthernet0/0/2]quit
[lsw3]interface Vlanif 10
[lsw3-Vlanif10]ip address 192.168.10.254 255.255.255.0
[lsw3-Vlanif10]quit
[lsw3]interface Vlanif 20
[lsw3-Vlanif20]ip address 192.168.20.254 255.255.255.0
[lsw3-Vlanif20]quit
[lsw3]interface Vlanif 30
[lsw3-Vlanif30]ip address 192.168.30.254 255.255.255.0
[lsw3-Vlanif30]quit
[lsw3]interface Vlanif 40
[lsw3-Vlanif40]ip address 192.168.40.254 255.255.255.0
[lsw3-Vlanif40]quit
save

三、验证

看各个vlan中的电脑是否能够ping通
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

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

猜你喜欢

转载自blog.csdn.net/weixin_43996007/article/details/103753692
今日推荐