Saturday 25 July 2015

Intervlan Routing

One of the main topics in CCNA is Inter-vlan routing or Router on a stick is a method of routing between different Vlans.As you would have probably guess each vlan is a separate broadcast domain and can't communicate with other vlan even if they reside on the same switch.To enable connectivity between them, we need a router.Suppose you have created 5 vlans on a switch and each has separate IP address space.First ,we will assign hosts to vlans and create virtual interfaces on router,one virtual interface for one vlan.Virtual interfaces are not real interfaces like with physical interface which you can see Ethernet port on a computer or a laptop,router or switch but virtual interfaces which you can't see except in configuration,they don't exist physically,they are a function of a software which gives you felling like you are working on a physical interface.

This is the topology in which i have created 5 vlans on a switch and assigned pc to each vlan.IP address range for each pc is also different from other.If you configure IP address on each PC and try to ping ,they will not communicate as they are in different IP address space.PING is a tool to check the connectivity between two devices.It stand for Packet Internet Groper.I am using Packet Tracer by Cisco which is a network simulator program which gives you flexibility to make networks and test with different devices.


PC1 has an IP address - 192.168.10.1 
PC5 has an IP address-  192.168.10.67 

To configure IP address to pc,Click on a pc>Desktop>IP configuration>type the ip address.







To ping,Go to Command Prompt>type ping 192.168.10.65 (where 192.168.10.65 is the ip address of the host which we want to test the connectivity to ,which you can see is unsuccessful)



Steps to Intervlan Routing :
Connect one of switch interface to router
Create virtual interfaces on router.(one for each vlan)
Give them IP addresses in the same IP address range in which hosts reside.
Enable 802.q (standard which supports Vlans)with vlan number
Make interface trunk
Create Switch Virtual interface on switch(which we will talk about later)
Give hosts default-gateway of router's virtual interface

Now, we add router and our topology looks like picture given below-


Configurations on router :
Router>
Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface fa0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.240
Router(config-subif)#interface fa0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 192.168.10.65 255.255.255.240.
Router(config-subif)#exit
Router(config)#interface fastEthernet 0/0
I show configuration for first two.
Let's dig deeper what this means.

Router(config)#interface fa0/0.10 (This is a command to create sub-interface on a router.Normally you would configure fa0/0 on a router but for sub-interface we add dot . and number which specify the vlan. For ex- fa0/0 is the physical interface on a router and .10 tells the router for which vlan this interface is created.In this case its 10,You can see i have associated  number 20 to second interface.

Router(config-subif)#encapsulation dot1Q 10

"Encapsulation dot1q" tells router to enable 802.q encapsulation and 10 is the vlan number.

Router(config-subif)#ip address 192.168.10.1 255.255.255.240.

This is the ip address of the interface itself.
Last, we enable the fa0/0 by no shutdown command.

Configuration on Switch :

Switch(config)#interface vlan 10
Switch(config-if)#ip address 192.168.10.2 255.255.255.240. 

As mentioned above,every vlan is a separate broadcast domain and switch should have some mechanism to know where this data is come form and where it is intended.We also need a virtual interface on switch (SVI)which is associated with a separate vlan.For 5 vlans,we will create 5 virtual interfaces .

So the configurations will be :
PC IP address : 192.168.10.1
Switch virtual interface : 192.168.10.2
Router virtual interface  : 192.168.10.3 
PC default-gateway  :  192.168.10.3

Make router's virtual interface a default-gateway for PC.

Need any help,leave a reply.

1 comment:

  1. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing. Feel free to visit my website;

    How do I Find my Dlink Wifi Password?
    How to Use Linksys Router as Wifi Extender?
    How To Setup Asus Onhub Router?
    Guide: Asus Rt-n16 Router Setup
    Asus Router Keeps Disconnecting From Internet

    ReplyDelete