路由器的配置
interface Ethernet0/0/0
 undo shutdown
#
interface Ethernet0/0/0.1
 vlan-type dot1q 2
 ip address 192.168.2.1 255.255.255.0
#
interface Ethernet0/0/0.2
 vlan-type dot1q 3
  ip address 192.168.3.1 255.255.255.0
 
交换机的配置
vlan batch 2 to 3
interface Ethernet0/0/1
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 3
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094