Orbit-Computer Solutions.Com

Computer Training & CCNA Networking Solutions
Chika Nwokeoma, EzineArticles.com Basic Author
 
 
 
 
Add to Favorite

Configure Router-on-a-Stick Inter-VLAN Routing

In a VLAN, only hosts that are members of same VLAN can communicate. To change this and allow inter-VLAN communication, you need a router or a layer 3 device. The router or layer 3 device interface port connecteted to the switch must be configured into logical interfaces called subinterface - one for each VLAN. this is achieved by setting the interface to trunk with encapsulation.
 
As ever, before configuring the router, configure the switch that it will be connected to.
Using the diagram below, Router R1 is connected to switch SW1 on trunk port F0/3. VLANs 10 and 20 have also been added to switch SW1
 
                              Router–on-a-Stick Inter-VLAN Configuration
 
Inter-VLAN Routing

 

from the topology above, VLANs 10 and 20 will be created on switch SW1 using the vlan 10 and vlan 20 commands.

Example switch configuration command:

SW1#config t
SW1(config)#vlan 10
SW1(config-vlan)#vlan 20
SW1(config-vlan)#exit
 
The fastethernet (fa0/3) will be set to trunk mode:
 
SW1(config)#interface fa0/3
SW1(config-if)#switchport mode trunk
SW1(config-if)#end
SW1#

As seen above, because switch port F0/3 will been configured as a trunk port, you do not have to assign any VLANs to the port. And VLANs 10 and 20 had been created too.

 You cannot use the switchport mode dynamic auto or switchport mode dynamic desirable commands because the router does not support dynamic trunking protocol.

Dont forget save the configuration so that it is not lose after a reload of the switch, use the copy running-config startup-config command in privileged EXEC mode to back up the running configuration to the startup configuration.

Next, the router can be configured to perform the inter-VLAN routing

Example of router R1 configuration command:

R1#config t
R1(config)#interface fa0/0.10
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 192.168.1.1 255.255.255.0
R1(config-subif)#interface fa0/0.20
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip address 192.168.2.1 255.255.255.0
R1(config-subif)#interface fa0/0
R1(config-if)#no shut
R1(config-if)#end

As you can see in the above, the configuration of multiple subinterfaces is different than when physical interfaces are used.

Each subinterface is created using the interface interface_id.Subinterface_id global configuration mode command. After that, VLAN ID is assigned using the encapsulation dot1q vlan_id subinterface configuration mode command.

Next, you assign the IP address for the subinterface using the ip address ip_address subnet_mask subinterface configuration mode command.

This process is repeated for all the router subinterfaces that are needed to route between the VLANs configured on the network. Each router subinterface needs to be assigned an IP address on a unique subnet for routing to occur.

Note:

You do not need to execute a no shutdown command at the subinterface level because it does not enable the physical interface. Cisco routers are configured to route traffic between the local subinterfaces by default, as a result, routing does not specifically need to be enabled

Next, use the show ip route command from privileged EXEC mode to examine the routing table.

To verify the router configuration, use the show running-config command in privileged EXEC mode. The show running-config command displays the current operating configuration of the router.:

Interface   Subinterface            Gateway IP Address/Mask   VLAN ID          Router Encapsulation

Fa0/0              fa0/0.10            192.168.1.1/24                         VLAN 10          encapsulation dot1q 10
Fa0/0              fa0/0.20            192.168.2.1/24                         VLAN 20           encapsulation dot1q 20
 
 
 
 
 
 
 
 
 
 
 
Custom Search
 
 
 
 
 
 Resources
 

        

  
 
(c) Copywrite 2012. Orbit-Computer-Solutions.Com. All rights reserved.   Web Links  Privacy Policy   
 
The information provided on this website is for informational purposes only. Orbit-computer-solutions.com makes no warranties, either expressed or implied,
 with respect to any information contained on this website.
Orbit -computer-solutions.com reserves the right to change this policy at any time without prior notice.
Cisco and All related product mentioned in any portion of this website are the registered trademarks of Cisco.com their respective owners.
Microsoft Windows and All related products mentioned in any portion of this website are registered trademark of Microsoft Corporation.