Tuesday, September 20, 2011

INTER-VLAN ROUTING,ROUTER ON A STICK


To have the reachbility between two vlans  we need an L3 device which here i used the router, we can also use any L3 switch to route between the two vlans here i will show the configurations in the two scenarios.First we discuss about router, when the router is connected we use a sub-interface which we have to "encapsulate" of frames,why because the port which it connects to switch should be a trunk port which by default allows all the vlans and all the vlans travels through the trunk with vlan tag, so here we have to encapsulate that with specific vlan number for that particular sub-interface ,if the number of vlans increases the no of sub-interfaces increases,in the above picture i'd like to route between two vlans thats why i used two sub-interfaces and encapsulated with their respective vlans.

so when it comes to the switch we have to configure the ports as access to which vlans they belongs to,and the port which connects to the router we have to configure as trunk port so that here it allows both the vlans traffic through it.

if you guys use an L3 switch instead of router then give :ip routing" command in the privileged mode and also in L3 switches before making a port to trunk mode we have to use "switchport trunk encapsulation dot1q " command.


ROUTER CONFIGURATION:
interface FastEthernet0/0.2
encapsulation dot1Q 2
ip address 10.0.0.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 3
ip address 10.0.1.1 255.255.255.0


SWITCH CONFIGURATION:
interface FastEthernet0/1
 switchport mode trunk

!

interface FastEthernet0/2
switchport access vlan 2
!
interface FastEthernet0/3
switchport access vlan 3
!
interface FastEthernet0/4
switchport access vlan 2
!
interface FastEthernet0/5
switchport access vlan 3


PC0
IP:10.0.1.2
SUBNET MASK:255.255.255.0
GATEWAY:10.0.1.1


PC3
IP:10.0.1.3
SUBNET MASK:255.255.255.0
GATEWAY:10.0.1.1


PC1
IP:10.0.0.2
SUBNET MASK:255.255.255.0
GATEWAY:10.0.0.1


PC2
IP:10.0.0.3
SUBNET MASK:255.255.255.0
GATEWAY:10.0.0.1

No comments:

Post a Comment