使用H3C模拟器配置VLAN相关项目-wx5c7fb2a24f7a5的博客

组网需求:
如 图1-1 所示,小区用户Host A、Host B、Host C分别与Device的端口GigabitEthernet 1/0/1、GigabitEthernet 1/0/2 、GigabitEthernet 1/0/3 相连, Device 设备通过GigabitEthernet 1/0/4 端口与外部网络相连。现需要实现小区用户Host A、Host B和Host C彼此之间二层报文不能互通,但可以和外部网络通信。试验拓扑图如下:
使用H3C模拟器配置VLAN相关项目
配置步骤:
创建隔离组2。
<Device> system-view
[Device] port-isolate group 2
将端口GigabitEthernet 1/0/1、GigabitEthernet 1/0/2、GigabitEthernet 1/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
验证配置如图所示:
使用H3C模拟器配置VLAN相关项目
组网需求:
? Host A 和Host C 属于部门A,但是通过不同的设备接入公司网络;Host B 和Host D 属于部
门B,也通过不同的设备接入公司网络。
? 为了通信的安全性,也为了避免广播报文泛滥,公司网络中使用 VLAN 技术来隔离部门间的
二层流量。其中部门A 使用VLAN 100,部门B 使用VLAN 200。
? 现要求不管是否使用相同的设备接入公司网络,同一 VLAN 内的主机能够互通,即Host A 和
Host C 能够互通,Host B 和Host D 能够互通。
配置步骤:
(1) 配置 Device A
创建VLAN 100,并将GigabitEthernet1/0/1 加入VLAN 100。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA-vlan100] port gigabitethernet 1/0/1
[DeviceA-vlan100] quit
创建VLAN 200,并将GigabitEthernet1/0/2 加入VLAN 200。
[DeviceA] vlan 200
[DeviceA-vlan200] port gigabitethernet 1/0/2
[DeviceA-vlan200] quit

#为了使Device A 上VLAN 100 和VLAN 200 的报文能发送给Device B , 将
GigabitEthernet1/0/3 的链路类型配置为Trunk,并允许VLAN 100 和VLAN 200 的报文通过。
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-type trunk
[DeviceA-GigabitEthernet1/0/3] port trunk permit vlan 100 200

(2) Device B 上的配置与Device A 上的配置相同,不再赘述。

(3) 将Host A 和Host C 配置在一个网段,比如192.168.100.0/24;将Host B 和Host D 配置在
一个网段,比如192.168.200.0/24。