配置思路:
交换机连接pc接口配置access类型
连接交换机设备接口配置trunk类型
链接核心层设备接口配置access类型
trunk接口允许50 60 40 10 20 30 999通过
access接口只允许本接口vlan通过
链路类型
实际链路配置:
[LSW4]vlan batch 50 60 40 10 20 30 999
[LSW4]interface g0/0/1
[LSW4-GigabitEthernet0/0/1]port link-type access
[LSW4-GigabitEthernet0/0/1]port default vlan 50
[LSW4-GigabitEthernet0/0/1]q
[LSW4]interface g0/0/2
[LSW4-GigabitEthernet0/0/2]port link-type trunk
[LSW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 50 60 40 10 20 30 999
[LSW4-GigabitEthernet0/0/2]q
[LSW4]interface Eth-Trunk 1
[LSW4-Eth-Trunk1]display this
[LSW4]interface Eth-Trunk1
[LSW4-Eth-Trunk1]port link-type trunk
[LSW4-Eth-Trunk1]port trunk allow-pass vlan 50 60 40 10 20 30 999
[LSW4-Eth-Trunk1]q
[LSW4]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/3
[LSW4-port-group]port link-type trunk
[LSW4-Ethernet0/0/1]port link-type trunk
[LSW4-Ethernet0/0/2]port link-type trunk
[LSW4-Ethernet0/0/3]port link-type trunk
[LSW4-port-group]port trunk allow-pass vlan 50 60 40 10 20 30 999
[LSW4-Ethernet0/0/1]port trunk allow-pass vlan 50 60 40 10 20 30 999
[LSW4-Ethernet0/0/2]port trunk allow-pass vlan 50 60 40 10 20 30 999
[LSW4-Ethernet0/0/3]port trunk allow-pass vlan 50 60 40 10 20 30 999
<LSW4>s
链路类型
[SW6]vlan batch 10 20 30 40 50 60 999
[SW6]interface e0/0/2
[SW6-Ethernet0/0/2]port link-type trunk
[SW6-Ethernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[SW6-Ethernet0/0/2]q
[SW6]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[SW6-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 60 999
[SW6-GigabitEthernet0/0/1]q
[SW6]interface g0/0/2
[SW6-GigabitEthernet0/0/2]port link-type access
[SW6-GigabitEthernet0/0/2]port default vlan 40
[SW6]interface e0/0/1
[SW6-Ethernet0/0/1]port link-type access
[SW6-Ethernet0/0/1]port default vlan 40
[SW6-Ethernet0/0/1]q
<SW6>sa
[LSW1]vlan batch 10 20 30 40 50 60 999
[LSW1]port-group group-member GigabitEthernet0/0/1 GigabitEthernet 0/0/2
[LSW1-port-group]port link-type trunk
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW1]port-group group-member Ethernet 0/0/1 Ethernet 0/0/2
[LSW1-port-group]port link-type access
[LSW1-Ethernet0/0/1]port link-type access
[LSW1-Ethernet0/0/2]port link-type access
[LSW1-port-group]port default vlan 10
[LSW1-Ethernet0/0/1]port default vlan 10
[LSW2]vlan batch 10 20 30 40 50 60 999
[LSW2]port-group group-member GigabitEthernet 0/0/1 GigabitEthernet 0/0/2
[LSW2-port-group]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/2]port link-type trunk
[LSW2-port-group]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW2-port-group]q
[LSW2]port-group group-member Ethernet 0/0/1 Ethernet 0/0/2
[LSW2-port-group]port link-type access
[LSW2-Ethernet0/0/1]port link-type access
[LSW2-Ethernet0/0/2]port link-type access
[LSW2-port-group]port default vlan 20
[LSW2-Ethernet0/0/1]port default vlan 20
[LSW2-Ethernet0/0/2]port default vlan 20
[LSW3]vlan batch 10 20 30 40 50 60 999
[LSW3]port-group group-member GigabitEthernet 0/0/1 GigabitEthernet 0/0/2
[LSW3-port-group]port link-type trunk
[LSW3-GigabitEthernet0/0/1]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-port-group]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW3]port-group group-member Ethernet 0/0/1 Ethernet 0/0/2
[LSW3-port-group]port link-type access
[LSW3-Ethernet0/0/1]port link-type access
[LSW3-Ethernet0/0/2]port link-type access
[LSW3-port-group]port default vlan 30
[LSW3-Ethernet0/0/1]port default vlan 30
[LSW3-Ethernet0/0/2]port default vlan 30
[LSW5]vlan batch 10 20 30 40 50 60 999
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW5-GigabitEthernet0/0/1]port link-type access
[LSW5-GigabitEthernet0/0/1]port default vlan 60
[LSW5-GigabitEthernet0/0/1]q
[LSW5]port-group group-member GigabitEthernet 0/0/2 Ethernet0/0/1 Ethernet0/0/2
Ethernet0/0/3 Eth-Trunk 1
链路类型
[LSW5-port-group]port link-type trunk
[LSW5-GigabitEthernet0/0/2]port link-type trunk
[LSW5-Ethernet0/0/1]port link-type trunk
[LSW5-Ethernet0/0/2]port link-type trunk
[LSW5-Ethernet0/0/3]port link-type trunk
[LSW5-Eth-Trunk1]port link-type trunk
[LSW5-port-group]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW5-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW5-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW5-Ethernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW5-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 60 999
[LSW5-Eth-Trunk1]port trunk allow-pass vlan 10 20 30 40 50 60 999