vlan batch 10 20
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 10 20
vlan batch 10 20 100 200
vlan 100
aggregate-vlan
access-vlan 10 20
interface Vlanif100
ip address 172.16.1.254 255.255.255.0
interface Vlanif200
ip address 172.16.200.1 255.255.255.0
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/2
port link-type access
port default vlan 200
最终端pc1不能ping通pc2,但可以ping通网关和其它vlan,pc5