三层交换机配置:
Switch>enable
Switch#configure terminal
Switch(vlan)#vlan 10 name VLAN10
Switch(vlan)#vlan 20 name VLAN20
Switch(config)#interface FastEthernet0/1
Switch(config-if)#switchport trunk allowed vlan add 10
Switch(config-if)#switchport trunk allowed vlan add 20
Switch(config)#interface FastEthernet0/2
Switch(config-if)#switchport trunk allowed vlan add 10
Switch(config-if)#switchport trunk allowed vlan add 20
Switch(config)#interface vlan10
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config)#interface vlan20
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config)#ip routing
Switch#show ip route