Monday 17 December 2012

Inter Vlan routing(Router On A Stick and L3 ports settings)

PURPOSE OF THIS LAB:

I created this lab to review inter vlan routing with L2 switches and L3 switches.
I'm sorry I don't have enough time to explain the theory and go into deep explanations
 but i believe by watching and experimenting you can learn a lot.

There is a couple of subjects here:
  • creating vlans and assigning ports
  • allowing vlans on a trunk
  • Router on a stick
  • Setting a switch interface as a Layer 3 interface.
  • Enabling routing on a Layer 3 switch

TOPOLOGY:
 
OUR TASK:
  • We have Layer 2 switch incapable of routing functions on the right and we want users in VLAN 10 (PC0) to be able to communicate with users in VLAN 20(PC1).We used a router to make routing possible so your task is to set Router on a stick to make this work.
  • The Topology on the right is L3 switch and we want to be able to do the same things too.Making user from 192.168.1.0/24 segment communicate with users on 198.168.2.0/24 segment.
STEPS TO ACCOMPLISH THE 1st TASK:
  1. create vlan on the L2 switch and assign ports linked to users to those vlans
  2. set the link between the router and the switch as a trunk
  3. set the router
  4. set the pcs and test connectivity

create vlan on the L2 switch and assign ports linked to users to those vlans
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#sw mode acc
Switch(config-if)#sw acc vlan 10
Switch(config-if)#int f0/2
Switch(config-if)#sw mode acc
Switch(config-if)#sw acc vlan 20
Switch(config-if)#end
Switch#sh vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13, Fa0/14, Fa0/15
                                                Fa0/16, Fa0/17, Fa0/18, Fa0/19
                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                Fa0/24, Gig1/1, Gig1/2
10   VLAN0010                         active    Fa0/1
20   VLAN0020                         active    Fa0/2

 ② set the link between the router and the switch as a trunk

Switch(config)#int f0/3
Switch(config-if)# switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 10,20
Switch(config-if)#end

set the router

Router(config)#int f0/0
Router(config-if)#no shut   << make sure it's up
Router(config-if)#no ip add  
Router(config-if)#int f0/0.1   <<< create a subinterface
Router(config-subif)#encap dot1Q 10  <<< puts it on vlan 10
Router(config-subif)#ip add 192.168.1.254 255.255.255.0 << assign IP
Router(config-subif)#int f0/0.2  << create 2nd subinterface
Router(config-subif)#encap dot1Q 20  << puts it on vlan 20
Router(config-subif)#ip add 192.168.2.254 255.255.255.0 << assign IP
Router(config-subif)#end

set the pcs and test connectivity

PC0 ip:192.168.1.1/24  | GW:192.168.1.254
PC1 ip:192.168.2.1/24  | GW:192.168.2.254



 STEPS TO ACCOMPLISH THE 2nd TASK:

  1. Setting ports on the switch as L3 interfaces
  2. Enabling routing
  3. Setting the PCs