第一步 搭建实验拓扑
2.创建eth-trunk使两个物理接口逻辑成一个
[sw1]int Eth-Trunk 0
[sw1-Eth-Trunk0]q
[sw1]int g0/0/23
[sw1-GigabitEthernet0/0/23]eth-trunk 0
[sw1-GigabitEthernet0/0/23]int g0/0/24
[sw1-GigabitEthernet0/0/24]eth-trunk 0
[sw2]int Eth-Trunk 0
[sw2-Eth-Trunk0]q
[sw2]int g0/0/23
[sw2-GigabitEthernet0/0/23]eth-trunk 0
[sw2-GigabitEthernet0/0/23]int g0/0/24
[sw2-GigabitEthernet0/0/24]eth-trunk 0
3.做trunk干道
[sw1]port-group group-member GigabitEthernet 0/0/2 to GigabitEthernet 0/0/3 Eth-Trunk 0 这个组包括g0/0/2和g0/0/3接口以及eth-trunk 0
[sw1-port-group]port link-type trunk 把这个组所有的接口定义为trunk
[sw1-port-group]port trunk allow-pass vlan 1 to 2 允许vlan1和vlan2通过
[sw2]port-group group-member GigabitEthernet 0/0/2 to GigabitEthernet 0/0/3 Eth-Trunk 0
[sw2-port-group]port link-type trunk
[sw2-port-group]port trunk allow-pass vlan 1 to 2
[sw3]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[sw3-port-group]port link-type trunk
[sw3-port-group]port trunk allow-pass vlan 2 默认有vlan1 就不用写了
[sw4]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[sw4-port-group]port link-type trunk
[sw4-port-group]port trunk allow-pass vlan 2