What is Inter-VLAN Routing?

  • Layer 2 switches can’t forward traffic between VLANs without the assistance of a router
  • Inter-VLAN routing is a process for forwarding network traffic from one VLAN to another using a router

Types of Inter-VLAN Routing:

  1. Legacy inter-VLAN routing
  2. Router-on-a-stick inter-VLAN routing
  3. Multilayer Switch Inter-VLAN Routing

Legacy Inter-VLAN Routing:

In the past, actual routers were used to route between VLANs. Each VLAN was connected to a different physical router interface. Packets would arrive on the router through one interface, be routed, and leave through another. Since the router interfaces were connected to VLANs and had IP addresses from that specific VLAN, routing between VLANs was achieved. Simple solution but not scalable. Large networks with a large number of VLANs would require lots of router interfaces.

Router-On-A-Stick Inter-VLAN Routing

  • The so-called router-on-a-stick approach uses a different path to route between VLANs
  • One of the router’s physical interfaces is configured as an 802.1Q trunk port. Now that interface can understand VLAN tags
  • Logical subinterfaces are then created. One subinterface per VLAN
  • Each subinterface is configured with an IP address from the VLAN it represents
  • VLAN members (hosts) are configured to use the subinterface address as a default gateway.
  • Only one of the router’s physical interfaces is used

Multilayer Switch Inter-VLAN Routing

  • Multilayer switches can perform Layer 2 and Layer 3 functions. Routers are not required anymore
  • Each VLAN existent in the switch is an SVI
  • SVI is seen as layer 3 interfaces
  • The switch understands network layer PDUs and therefore, it can route between its SVIS just as a router routes between its interfaces
  • With a multilayer switch, traffic is routed internally to the switch device
  • Very scalable solution

Legacy Inter-VLAN Routing Configuration:

  • Legacy inter-VLAN routing requires routers to have multiple physical interfaces
  • Each one of the router’s physical interfaces is connected to a unique VLAN
  • Each interface is also configured with an IP address for the subnet associated with the particular VLAN
  • Network devices use the router as a gateway to access the devices connected to the other VLANs

Switch Configuration:

S1(config)# vlan 10 
S1(config-vlan) # vlan 30 
S1(config-vlan) # interface f0/11 
S1(config-if)# switchport access vlan 10 
S1(config-if)# interface f0/4 
S1(config-if)# switchport access vlan 10 
S1(config-if)# interface f0/6 
S1(config-if)# switchport access vlan 30 
S1(config-if)# interface f0/5 
S1(config-if)# switchport access vlan 30 
S1(config-if)# end 
*Mar 22 01:22:56.751: %SYS-5-CONFIG_I: Configured from console by console 

S1# copy running-config startup-config 
Destination Filename [startup-config]? 
Building configuration... [OK]

Router Interface Configuration:

R1(config)# interface g0/0 
R1 (config-if)# ip address 172.17.10.1 255.255.255.0 
R1(config-if)# no shutdown 
*Mar 22 01:42:12.951: LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up 
*Mar 22 01:42:13.951: LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up 

R1(config-if)# interface g0/1 
R1 (config-if)# ip address 172.17.30.1 255.255.255.0 
R1 (config-if)# no shutdown 
*Mar 22 01:42:54.951: ELINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up 
*Mar 22 01:42:55.951: LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up 

R1 (config-if)# end 
R1# copy running-config startup-config

Router-On-A-Stick Inter-VLAN Routing Configuration:

  • An alternative to legacy inter-VLAN routing is to use VLAN trunking and subinterfaces
  • VLAN trunking allows a single physical router interface to route traffic for multiple VLANs
  • The physical interface of the router must be connected to a trunk link on the adjacent switch
  • On the router, subinterfaces are created for each unique VLAN on the network
  • Each subinterface is assigned an IP address specific to its subnet/VLAN and is also configured to tag frames for that VLAN

Switch Configuration:

S1(config)#vlan 10 
S1(config-vlan)#vlan 30 
S1(config-vlan)#interface f0/5 
S1(config-if)#switchport mode trunk 
S1(config-if)#end

Router Interface Configuration:

R1(config)#interface g0/0.10 
R1(config-subif)#encapsulation dot1q 10 
R1(config-subif)#ip address 172.17.10.1 255.255.255.0 
R1(config-subif)#interface g0/0.30 
R1(config-subif)#encapsulation dotiq 30 
R1(config-subif)#ip address 172.17.30.1 255.255.255.0 
R1(config)#interface g0/0 
R1(config-if)#no shutdown

Leave a Reply