Cisco Router-on-a-stick with Switch
SWITCH CONFIGURATION # conf t (config)# vlan database (config-vlan)# vlan 10 name RED (config-vlan)# vlan 20 name GREEN (config-vlan)# exit (config)# interface FastEthernet1/0/1 (config-if)# description trunk-to-router-on-a-stick (config-if)# switchport trunk encapsulation dot1q (config-if)# switchport mode trunk (config-if)# exit (config)# interface FastEthernet1/0/2 (config-if)# description connection-to-RED-VLAN (config-if)# switchport mode access (config-if)# switchport access vlan 10 (config-if)# exit (config)# interface FastEthernet1/0/3 (config-if)# description connection-to-GREEN-VLAN (config-if)# switchport mode access (config-if)# switchport access vlan 20 (config-if)# exit (config)# exit # copy run start ROUTER CONFIGURATION # conf t (config)# interface fastethernet 0/0.10 (config-if)# encapsulation dot1q 10 (config-if)# ip address [Link] [Link] (config-if)# exit (config)# interface fastethernet 0/0.20 (config-if)# encapsulation dot1q 20 (config-if)# ip address [Link] [Link] (config-if)# exit Now, in order for the two hosts to communicate between them, they must set as default gateway the IP address of the corresponding router subinterface address (e.g for host in VLAN 10 the gateway must be [Link] and for host in VLAN 20 the gateway must be [Link]).