Switch - External Router

External Router (Route-on-stick)

Divide physical interface to sub-interface and use each sub-interface to route traffic between VLAN, Each sub-interface can have IP address

This method is usually use for network that no have layer3-switch
at layer2-switch must have trunk port connect to router and other port use for host

Router1#conf t
Router1(config)#interface fa0/1.2    (2 is Vlan)
Router1(config-if)#encapsulation dot1q 2 (2 is Vlan) 
Router1(config-if)#ip address 192.168.1.1 255.255.255.0

encapsulation : dot1q or is1
encapsulation type must same with switch's encapsulation