一、端口隔离简介:
为了实现端口间的二层隔离,可以将不同的端口加入不同的VLAN,但VLAN资源有限。采用端口隔离特性,用户只需要将端口加入到隔离组中,就可以实现隔离组内端口之间二层隔离,而不关心这些端口所属VLAN,从而节省VLAN资源。从而达到隔离组内的端口与未加入隔离组的端口之间二层流量双向互通,但隔离组内流量无法互通。
二、组网需求
小区用户Host A、Host B、Host C分别与Device的端口GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3相连,Device设备通过GigabitEthernet1/0/4端口与外部网络相连。现需要实现小区用户Host A、Host B和Host C彼此之间二层报文不能互通,但可以和外部网络通信。
三、拓扑图
四、 配置步骤
# 创建隔离组2。
<Device> system-view
[Device] port-isolate group 2
# 将端口GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3加入隔离组2。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port-isolate enable group 2
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] port-isolate enable group 2
[Device-GigabitEthernet1/0/2] quit
[Device] interface gigabitethernet 1/0/3
[Device-GigabitEthernet1/0/3] port-isolate enable group 2
4. 验证配置
# 显示隔离组2中的信息。
[Device] display port-isolate group 2
Port isolation group information:
Group ID: 2
Group members:
GigabitEthernet1/0/1
GigabitEthernet1/0/2
GigabitEthernet1/0/3
以上信息显示Device上的端口GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3已经加入隔离组2,从而实现二层隔离,分别对应的Host A、Host B和Host C彼此之间不能Ping通。