[SW1]int Eth-Trunk 12
[SW1-Eth-Trunk12]trunkport Ethernet 0/0/1 to 0/0/3
[SW1-Eth-Trunk12]port trunk allow-pass vlan all
[SW2]int Eth-Trunk 12
[SW2-Eth-Trunk12]trunkport Ethernet 0/0/1 to 0/0/3
[SW2-Eth-Trunk12]port trunk allow-pass vlan all
[SW2-Eth-Trunk12]dis eth-trunk 12
Eth-Trunk12's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 3
--------------------------------------------------------------------------------
PortName Status Weight
Ethernet0/0/1 Up 1
Ethernet0/0/2 Up 1
Ethernet0/0/3 Up 1
[SW1]vlan batch 10 20
[SW1]int e0/0/4
[SW1-Ethernet0/0/4]port link-type access
[SW1-Ethernet0/0/4]port default vlan 10
[SW1]int e0/0/5
[SW1-Ethernet0/0/5]port link-type access
[SW1-Ethernet0/5]port default vlan 20
[SW2]VLAN 20
[SW2]int e0/0/4
[SW2-Ethernet0/0/4]port link-type access
[SW2-Ethernet0/0/4]port default vlan 20
PC>ping 192.168.1.4
Ping 192.168.1.4: 32 data bytes, Press Ctrl_C to break
From 192.168.1.4: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.1.4: bytes=32 seq=2 ttl=128 time=47 ms
From 192.168.1.4: bytes=32 seq=3 ttl=128 time=62 ms
From 192.168.1.4: bytes=32 seq=4 ttl=128 time=63 ms
From 192.168.1.4: bytes=32 seq=5 ttl=128 time=62 ms
--- 192.168.1.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/62/78 ms
PC>ping 192.168.1.3
Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
--- 192.168.1.3 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
原文:https://www.cnblogs.com/yu15/p/11206673.html