Just another Cisco blog
Archive for December 12, 2009
Router On A Stick Tutorial
Dec 12th
Someone asked me about configuring a router on a stick yesterday, so I figured I’d make a short tutorial on it. I haven’t seen this used much in the real world as L3 switches are so common, but it is something I had to learn for the CCNA. Router on a stick is used when for inter-VLAN routing when you have an L2 switch and a router. Here’s the topology:

Here we have an L2 switch with three VLANs connected to a router. Here’s the config:
Switch
Switch(config)#vlan 5 Switch(config-vlan)#exit Switch(config)#vlan 10 Switch(config-vlan)#exit Switch(config)#vlan 15 Switch(config-vlan)#exit Switch(config)#interface FastEthernet0/1 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk |
The switch config is pretty basic, we create VLANs 5, 10 and 15, then we make a trunk port to the router.
Router
Router(config)#interface FastEthernet0/0 Router(config-if)#no ip address Router(config-if)#interface FastEthernet0/0.5 Router(config-subif)#encapsulation dot1Q 5 Router(config-subif)#ip add 192.168.5.1 255.255.255.0 Router(config-subif)#interface FastEthernet0/0.10 Router(config-subif)#encapsulation dot1Q 10 Router(config-subif)#ip add 192.168.10.1 255.255.255.0 Router(config-subif)#interface FastEthernet0/0.15 Router(config-subif)#encapsulation dot1Q 15 Router(config-subif)#ip add 192.168.15.1 255.255.255.0 |
On the router, we go to the interface connected to the switch and make sure there is no IP address. Then we configure our subinterfaces with 802.1q and the appropriate VLAN. Then we give each subinterface an IP address. Now we can see all the subinterfaces are up:
Recent Comments