Vlan

INTERVLAN ROUTING

InterVLAN routing is a means of enabling communication between various VLANS in a switched network. VLANS by default do not communicate with each other, that is, there’s no exchange of packets between VLANS. Without interVLAN routing, John in VLAN 100 will not be able to send that holiday pics he took while in the Bahamas to Mary in VLAN 20.

There are two ways to do this

  1. Using an external router.
  2. Using a Cisco multilayer switch.

USING AN EXTERNAL ROUTER

To enable communication between VLANs, an external layer 3 device, think router, is added to the network, then a physical or logical link is created between the VLANS and the router. There are two possible ways to connect with the router;

  1. Connect the switch to the router with each physical link representing a VLAN

4vlans

Most Cisco books I’ve read have the habit of talking about this form of interVLAN routing in passing so much that I never bothered to know how to do the configuration or see how it works throughout my CCNA class and even after passing the exam, until I decided put it online. Actually this is an old and outdated form of routing VLANs, and no longer practiced; but it wouldn’t hurt to know it.

If you have 20 VLANs, you need a router with 20 interfaces to connect to, so the VLANs can talk to each other. Imagine having 100 VLANs in an organization, this has made this form of routing impracticable.

Anyway I tried it on a packet tracer, created VLANs, gave them IP addresses, mapped ports to VLANs and connect hosts.

Then I pinged the hosts in different VLANs expecting to make a home run, oops no luck! VLANs won’t talk. I had failed to place each of the switch link connecting to the router into their respective VLANs, I had left them in the default VLAN- VLAN 1. This was corrected and it works.

2. Router on a stick

Here, a single trunked link is made to carry all VLANs, and logical configuration, that is, IP addressing is done at the sub-interface level.

roaexvlan

Let’s do a little configuration using the image above. First, let’s go to the switch and trunk the link

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#int f0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#

Next, let’s enable the router interface and configure IP address at the sub-interface level

subintedited

Oh, we’ve got some things to explain here.

I had said earlier that IP addressing is done at the sub-interface level, under no condition must IP address be assigned to the interface, routing just won’t work.

Let’s break “encapsulation dot1q 2” into tiny bits

 

encapsulation dot1q – this means the frame identification method to be used is IEEE 802.1Q protocol.

2- This means VLAN 2. Each figure represents a VLAN

Finally, for the VLANs to communicate I didn’t have to invoke IP routing or configure any  routing protocol, they just worked like that.

 

 

INTERVLAN ROUTING USING MULTILAYER SWITCH

In the absence of a router, a Cisco multilayer switch can be used to route packets from one VLAN to another. Switches by default operate at layer 2, but a multilayer switch has both layer 3 and layer 4 (network and transport) capabilities in addition to layer 2 capabilities.

Now let’s do some configuration to enable routing on a multilayer switch

First we will need to create and name the VLANs on the multilayer switch

mlscreatevlanedited

Next is the assignment of IP to these VLANs. I chose to give each VLAN the last available IP in their respective subnet, any IP in the subnet can be used.mlscreateipedited

And on the other switch, the 2960 which serves as the access layer switch, the management VLAN which is VLAN 1 will be given an IP address and the switch itself will be given a default gateway. The multilayer switch will not use a default gateway because it’s acting as a layer 3 device.

2960edited

What’s next is the assignment of ports to different VLANs which I have talked about earlier in my first post about VLANs, attach PCs to the ports and assign IP address to the hosts.

One last thing to get the VLANs smiling, shaking hands and exchanging packets

iproutingedited

So now let’s test if our VLANs are communicating…… I’m pinging other VLANs from a host in VLAN 1

pingedited

Oh it’s all fine.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s