--交换机配置
int fa0/8 --交换机和路由器连接的接口
switchport mode trunk
--路由器配置
enable conf t
int fa0/0.1 --路由器接口的子接口
encapsulation dotlq 10
ip address 192.168.0.1 255.255.255.0 --网络号和vlan10号的一致
int fa0/0.2
encapsulation dotlq 20
ip address 192.168.1.1 255.255.255.0
int fa0/0.3
encapsulation dotlq 30
ip address 192.168.2.1 255.255.255.0
exit
int fa0/0
no shutdown