首先通过CONSOLE口或Telnet连接交换机,连接成功后,进入用户视图模式
然后输入sys进入系统视图模式[H3C]
sys
[H3C]

在系统视图模式下创建三个VLAN,一个VLAN 10,一个VLAN 20,一个VLAN 30

[H3C]vlan 10
[H3C-vlan10]quit
[H3C]vlan 20
[H3C-vlan20]quit
[H3C]vlan 30
[H3C-vlan30]quit
[H3C]

接下来将交换机的接口加入到相应的VLAN中,将g1/0/5加入到VLAN 10,将g1/0/6加入到VLAN 20,将g1/0/7加入到VLAN 30

[H3C]vlan 10
[H3C-vlan10]port g1/0/5
[H3C-vlan10]quit
[H3C]vlan 20
[H3C-vlan20]port g1/0/6
[H3C-vlan20]quit
[H3C]vlan 30
[H3C-vlan30]port g1/0/7
[H3C-vlan30]quit
[H3C]

最后再设置VLAN的接口IP地址,VLAN 10设置为192.168.10.1/24,VLAN 20设置为192.168.20.1/24,VLAN 30设置为192.168.30.1/24,如图所示:

[H3C]
[H3C]int vlan 10
[H3C-Vlan-interface10]ip add 192.168.10.1 255.255.255.0
[H3C]int vlan 20
[H3C-Vlan-interface20]ip add 192.168.20.1 255.255.255.0
[H3C]int vlan 30
[H3C-Vlan-interface30]ip add 192.168.30.1 255.255.255.0