华为1:跨交换机的vlan
vlan1:1-5
vlan2:6-10
vlan3:11-22
[S1]vlan batch 2 3
[S1]interface GigabitEthernet 0/0/1
[S1-GigabitEthernet0/0/1]port link-type trunk
[S1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/1]q
[S1]interface GigabitEthernet 0/0/2
[S1-GigabitEthernet0/0/2]port link-type trunk
[S1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[S2]vlan batch 2 3
[S2]port-group vlan1port
[S2-port-group-vlan1port]group-member Ethernet 0/0/1 to Ethernet 0/0/5 将交换机接口指定到相应的VLAN
[S2-port-group-vlan1port]port link-type access
[S2-port-group-vlan1port]port default vlan 1
[S2-port-group-vlan1port]q
[S2]port-group vlan2port
[S2-port-group-vlan2port]group-member Ethernet 0/0/6 to Ethernet 0/0/10
[S2-port-group-vlan2port]port link-type access
[S2-port-group-vlan2port]port default vlan 2
[S2-port-group-vlan2port]q
[S2]port-group vlan3port
[S2-port-group-vlan3port]group-member Ethernet 0/0/11 to Ethernet 0/0/22
[S2-port-group-vlan3port]port link-type access
[S2-port-group-vlan3port]port default vlan 3
[S2-port-group-vlan3port]q
[S2]interface GigabitEthernet 0/0/1
[S2-GigabitEthernet0/0/1]port link-type trunk 将交换机之间的连接链路设置成干道链路
[S2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
S3交换机同S2配置相同。。。
配置完成后,各vlanpc相互ping通;vlan间pc不通
附:
显示接口所属的VLAN
<S3>display port vlan
注意:
华为交换机当把某个vlan删除后,那么vlan下的端口会变为默认vlan1
思科交换机当把某个vlan删除后,那么vlan下的端口就不显示了(不存在)