实验目的:
1.实现VLAN10的两台主机互通; VLAN20的两台主机互通;
2.VLAN10与VLAN20主机不能互通.
拓扑图:
步骤:
1.依图配置PC1,PC2,PC3,PC4的IP,掩码,网关等.
2.配置LSW1,LSW2的VLAN10和VLAN20
<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]vlan 10
[sw1-vlan10]quit
[sw1]vlan 20
[sw1-vlan20]quit
[Huawei]sysname sw2
[sw2]vlan 10
[sw2-vlan10]quit
[sw2]vlan 20
[sw2-vlan20]quit
[sw2]
3.配置LSW1,LSW2与PC相连的接口类型为access,并将接口加入对应的VLAN
[sw1]interface g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type access
[sw1-GigabitEthernet0/0/1]port default vlan 10
[sw1-GigabitEthernet0/0/1]quit
[sw1]interface g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type access
[sw1-GigabitEthernet0/0/2]port default vlan 20
[sw1-GigabitEthernet0/0/2]quit
[sw2]interface g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type access
[sw2-GigabitEthernet0/0/1]port default vlan 10
[sw2-GigabitEthernet0/0/1]quit
[sw2]interface g0/0/2
[sw2-GigabitEthernet0/0/2]port link-type access
[sw2-GigabitEthernet0/0/2]port default vlan 20
[sw2-GigabitEthernet0/0/2]quit
4.配置LSW1,LSW2相连的接口类型为trunk,并配置允许VLAN通过
[sw1]interface g0/0/3
[sw1-GigabitEthernet0/0/3]port link-type trunk
[sw1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[sw1-GigabitEthernet0/0/3]quit
[sw2]interface g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20
[sw2-GigabitEthernet0/0/3]quit
5.测试
1.实现VLAN10的两台主机互通; VLAN20的两台主机互通;
2.VLAN10与VLAN20主机不能互通.
结束.