如果用户想进行二层隔离,用户可以将不同的端口加入不同的VLAN,但这样会浪费有限的VLAN资源。采用端口隔离功能,可以实现同一VLAN内端口之间的隔离。用户只需要将端口加入到隔离组中,就可以实现隔离组内端口之间二层数据的隔离。端口隔离功能为用户提供了更安全、更灵活的组网方案。
处于同一隔离区的PC无法相互通信。
LSW15配置
<Huawei>sy
[Huawei]undo in en
[Huawei]vlan 10
[Huawei-vlan10]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 10
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]port link-type access
[Huawei-Ethernet0/0/4]port default vlan 10
[Huawei-Ethernet0/0/4]int e0/0/5
[Huawei-Ethernet0/0/5]port link-type access
[Huawei-Ethernet0/0/5]port default vlan 10
[Huawei-Ethernet0/0/5]q
[Huawei]int e0/0/3
[Huawei-Ethernet0/0/3]port-isolate enable //开启隔离
[Huawei-Ethernet0/0/3]port-isolate enable group 1 //将接口放入隔离组1
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]port-isolate enable
[Huawei-Ethernet0/0/4]port-isolate enable group 1
LSW14配置
<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]undo in en
Info: Information center is disabled.
[Huawei]vlan 10 //需要创建vlan10,否则交换机会直接丢掉自身不存在的vlan的包
[Huawei-vlan10]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
LSW15配置
<Huawei>sy
[Huawei]undo in en
[Huawei]vlan 10
[Huawei-vlan10]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 10
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]port link-type access
[Huawei-Ethernet0/0/4]port default vlan 10
[Huawei-Ethernet0/0/4]int e0/0/5
[Huawei-Ethernet0/0/5]port link-type access
[Huawei-Ethernet0/0/5]port default vlan 10
测试联通性 所有PC可用和PC25和PC26通信
PC25和PC26不能相互通信