一、 实验拓扑图
二、实验要求:使得PC5、PC6、PC7、PC8四台电脑能实现互通
三、实现步骤及配置命令行
1.PC5、PC5、PC6、PC7、PC8基础配置,配置完记得都要点应用,否则不会保存
2.交换机LSW9、LSW10、LSW11、LSW12配置
①设置该交换机允许通过的vlan
[Huawei]vlan batch 10 20 30 40 100 200
②设置0/0/1端口模式
命令行:
<Huawei>system-view 进入系统视图
[Huawei]interface Ethernet 0/0/1 进入0/0/1端口视图
[Huawei-Ethernet0/0/1]port link-type access 0/0/1端口模式设置成access
[Huawei-Ethernet0/0/1]port default vlan 10 0/0/1端口允许vlan10通过
此时0/0/1端口设置已完成,同理可得LSW10、LSW11、LSW12的0/0/1端口模式需要设置为access,只是vlan有所不同,分别为vlan20,vlan30,vlan40,在拓扑图笔记中也可先行记下。
③设置0/0/2端口模式
因为0/0/2端口需要和多个vlan连接,所以模式设置成trunk
[Huawei]interface Ethernet 0/0/2 进入0/0/2端口视图
[Huawei-Ethernet0/0/2]port link-type trunk 0/0/2端口模式设置成trunk
[Huawei-Ethernet0/0/2]port trunk allow-pass vlan all 设置所有vlan都可以通过
此时0/0/2端口设置已完成,同理可得LSW10、LSW11、LSW12的0/0/2端口模式都需要设置为trunk。
3.交换机LSW7、LSW8配置
①同理可分别设置交换机LSW7、LSW8的0/0/1、0/0/2、0/0/3的六个端口模式都设置为trunk,并允许vlan10 20 30 40 100通过
②先创建一个接口 vlan,如图中的 vlan 100,并配置接口 IP 地址
LSW7交换机中
[Huawei]vlan batch 100
[Huawei]interface Vlanif 100
[Huawei-Vlanif100]ip address 192.168.1.2 24
[Huawei]ip route-static ip route-static 30.30.30.0 255.255.255.0 192.168.1.2
[Huawei]ip route-static ip route-static 40.40.40.0 255.255.255.0 192.168.1.2
建立从 SW7到目的网络 192.168.1.2/24 的静态路由
③LSW8交换机中
[Huawei]vlan batch 100
[Huawei]interface Vlanif 100
[Huawei-Vlanif100]ip address 192.168.1.2 24
[Huawei]ip route-static ip route-static 10.10.10.0 255.255.255.0 192.168.1.1
[Huawei]ip route-static ip route-static 20.20.20.0 255.255.255.0 192.168.1.1
建立从 SW8到目的网络 192.168.1.1/24 的静态路由
此时就可完成四台PC机的连接
我是菜鸡我是菜鸡我是菜鸡,发这篇文章仅仅为了记录学习过程和整理思路,刚开始学难免有些吃力,有错误欢迎大家指正!