Router On Stick Report
Router On Stick Report
Router On Stick Report
ROUTER ON STICK
Assignment #2
Let’s get inside the switch to create the VLANs 5,10and 15 and assign machines into it.
First, issue the show vlan brief to command to check for any existing vlans. In our case, there are no pre-
configured vlans. You will then issue the commands:
Switch#conf t
Switch(config)#vlan 2
Switch(config-vlan)#name Student
Switch(config-vlan)#vlan 3
Switch(config-vlan)#name Faculty
Switch(config-vlan)#vlan 4
Switch(config-vlan)#name Guest
Switch(config-vlan)#exit
Switch(config)#interface Vlan 2
Switch(config-if)#description Student Section
Switch(config-if)#ip address 192.168.5.0
Switch(config-if)#exit
Switch(config)#interface VlaN 3
Switch(config-if)#description Faculty
Switch(config-if)#ip address 192.168.10.0
Switch(config-if)#exit
Switch(config)#interface Vlan 4
Switch(config-if)#description Guest
Switch(config-if)#ip address 192.168.15.0
Switch(config-if)#exit
Switch(config-if)#end
This will create VLANs 5,10 and 15 with their corresponding names, descriptions and ip address. We will then
assign ports fa0/1-3 to VLAN 5 , ports fa0/1-3 to VLAN 10and ports fa0/4-5 to VLAN 15.
So, when you now issue the show vlan brief command. It will look something like this:
PC2 has an IP of 10.1.10.2 and it belongs to VLAN 20, it can successfully ping PC3 which is on the same VLAN
20 but cannot ping PC1 and PC2 which are on VLAN 10.
Use the interface type number.subint command in global configuration mode to create a unique
subinterface for each VLAN to be routed.
Use the encapsulation dot1q vlan_id command to enable 802.1Q trunking and associate each VLAN
with the subinterface.
We will now go inside the router to configure the 802.1Q trunk. It is advisable to use a router with a Gigabit
Ethernet interface if you are handling large amounts of data transfer.
Router#conf t
Router(config)#int fa0/0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
Router(config-if)#int fa0/0.10
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 10.1.10.1 255.255.255.0
Router(config-subif)#int fa0/0.20
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 10.1.20.1 255.255.255.0
Router(config-subif)#end
You can check if its already established routes to the VLAN subnets by using the show ip route command.
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Now, most Cisco routers do not attempt to negotiate trunking, so make sure you issue the switchport mode
trunk command on the matching switch interface.
Switch#conf t
Switch(config)#int fa0/1
Switch(config-if)#switchport mode trunk
Now, let’s see if we can ping a machine from another VLAN. And as you can see on the image below, PC2 from
VLAN 20 can now ping PC1 from VLAN 10.