交换机配置:
vlan 1
vlan 2
interface FastEthernet0/1
switchport mode trunk
interface FastEthernet0/2
switchport mode access
interface FastEthernet0/24
switchport access vlan 2
switchport mode access
路由器配置:
interface FastEthernet0/0
no shutdown
interface FastEthernet0/0.1
encapsulation dot1Q 1
ip address 192.168.0.1 255.255.255.0
interface FastEthernet0/0.2
encapsulation dot1Q 2
ip address 192.168.1.1 255.255.255.0