vlan实现主机通信
通过vlan实现pc1和pc2以及pc5通信,pc1和pc3以及pc4不能通信
1.将pc1 ,pc2,pc5划入vlan10
将pc3和pc4划入vlan20
vlan 10 20
在交换机1上操作:
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 10
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 10
[Huawei]interface GigabitEthernet 0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
交换机互联接口G0/0/4配置为trunk
[Huawei]interface GigabitEthernet 0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan all
在交换机2上面的操作
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
[Huawei]interface GigabitEthernet 0/0/2
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 10
[Huawei]interface GigabitEthernet 0/03
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan all
2.就实现了上述功能