Configure Inter VLAN Routing on Cisco Router and Layer 3 Switches

A step by step guide to configure Inter-VLAN Routing on the Cisco router or layer 3 switches. Basically, on a VLAN, no host can communicate with hosts within other VLANs. It means only hosts that are members of the same VLAN can communicate with each other. So if you want your VLANs hosts can communicate with each other, you must configure inter-VLAN routing using a router or a layer 3 switch. Here we completely demonstrate the Inter-VLAN configuration using a Cisco router and a layer 3 switch.

The router you are using for Inter-VLAN routing must be compatible and support Inter-Switch Link (ISL) which is a Cisco Systems proprietary protocol, and IEEE 802.1q frame format for routing on the Fast Ethernet interfaces. In Inter-VLAN the physical Fast Ethernet interface of the router is divided into sub-Interfaces for each VLAN. You can set IP address for each sub-Interface in order to route between VLANs.

How to Create VLAN on Cisco Switches?

Let’s configure it on the below Inter-VLAN routing Lab. Download the Packet Tracer Inter-VLAN routing Lab for CCNA or create your own Lab.

1. First of all, create two VLAN in the switch and named VLAN A and VLAN B with the following command.


2. OK, the VLANs A and B are created successfully. Now check them with “show vlan” command.

Inter-VLAN Routing

Configure Inter-VLAN Routing

3. You see the result on the screenshot, the VLANs are ready for assigning switch ports to them.

Assigning Switch Ports for VLANs

In this section, the switch ports are divide and assign to VLANs. Before configuring Inter-VLAN routing, a host in a VLAN can only communicate within its own VLAN and not reach to other VLANs. So let’s configure it.

1. Try to assign switch ports for each VLANs with the following commands.

Assigning Switch Ports to VLANs

Assigning Switch Ports to VLANs


2. Now the port FastEthernet 0/2 and FastEthernet 0/5 are members of VLAN 2 which named VLAN-A. Go to set the PC3 and PC2 to VLAN-B.

3. Let’s assign a range or ports to a VLAN using “interface range” command.


Note: The interface range command can assign a range of interfaces to a VLAN. Read more about basic VLAN configuration on “Configure VLAN on Cisco Switches Using Cisco Packet Tracer” post.

Assign Switch Ports to VLAN

Assign Switch Ports to VLAN

4. Now we have just done the basic VLAN configuration like creating VLAN and assigning switch ports to VLANs. Let’s enable Trunking mode on the switch port to the router and then configure Inter-VLAN routing on the router.

Configure Trunking Ports on Switch

With the command “switch port mode trunk” you can configure trunking on the FastEthernet 0/1 port of the SW1. The VLAN Trunking Protocol (VTP) let the VLANs transmit theirs traffics over a physical line simultaneously. Read more about VTP on Wikipedia website.

Configuring Trunk Ports

Configuring Trunk Ports

1. Just navigate to FastEthernet 0/1 interface and type “switchport mode trunk the press enter to enable trunking on Fa0/1 interface line.


2. Now the VLANs can transmit traffic over the FastEthernet 0/1 without any problems.

Note: Try to enable trunking mode only to interface between to switch or router devices. It’s not necessary to enable it on the interface of the switch to PC.

Configure Inter-VLAN Routing on Cisco Router

Finally, the lab is ready to configure Inter-VLAN routing. If you test the PCs, they can ping with each other within a VLAN but not with other VLANs. So in order to communicate they need routing. Not network routing protocols such as Static routing or dynamic routing like RIP, and OSPF. Just need Inter-VLAN Routing which you simply configure according to below step by step Inter-VLAN routing guide.

1. Try to assign an IP address to the router and enable the interface you want to configure inter-VLAN routing.

VLAN Routing

VLAN Routing


2. Good, the IP with the subnet mask of is assigned for physical FastEthernet 0/0 interface.

Note: We need to have subinterface for each VLANs on the router. The subinterface is a virtual interface card that inter-VLAN doing routing using them.

3. Now try to create a subinterface for each VLAN with interface command and assign IP address from the different network for each VLAN. In this case, I have subnetted the IP address to 3 networks.


4. See the result with “do show ip interface brief” from sub-interface area.

Create Sub-Interface

Create Sub-Interface

The virtual sub-interface FastEthernet0/0.2 has created and it has the IP address. This sub-interface act as a default gateway for VLAN-A with an address of

5. Do the same to create a sub-interface for VLAN-B also.


6. Everything is fine, but you see the error with red color! It is because we forgot to set the encapsulation dot1Q command. Before assigning an IP address to a sub-interface, you should set IEEE 802.1q with encapsulation command.

Finally, all VLANs hosts can communicate with each other. That’s all you need to configure Inter-VLAN routing on your corporate network. Download the complete Lab of Inter-VLAN routing Cisco Packet Tracer Lab. Follow the below steps if you want to configure inter-VLAN on Layer 3 Switches or troubleshooting inter-VLAN on routers and switches.

Configure Inter-VLAN Using Layer 3 Switches

Work the same, just need a Cisco Layer 3 switch. To configure Inter-VLAN on a Layer 3 switch, you must assign an IP address to VLANs instead of sub-interfaces. Assigning an IP address to VLAN is easy, only read the “Assigning IP address to VLAN” section at the end of this articles.

To configure Inter-VLAN routing using layer 3 switches, you don’t need router anymore. All configuration has done within the layer 3 switch.

Troubleshooting and Assigning IP address to VLANs

As this post is related to configure Inter-VLAN routing, so we must do some more about VLAN configuration such as assigning IP address to VLANs, controlling VLANs remotely with Telnet, and some essential troubleshooting commands.

How to Assign an IP address to VLANs?

In order to assign an IP address to a VLAN, simply go to VLAN and set the IP address like assigning IP address to an interface of a router.


Check it with “do show ip interface brief” command, whether the default VLAN 1 has gotten the IP address of or not.

Default VLAN 1

Default VLAN 1 – Configure Inter-VLAN Routing

Yes, that’s fine. This can help you remotely configure VLANs through the internet or network.

Troubleshooting Inter-VLAN Routing

To see the VLANs on a switch, type the “show vlan” command. This command will list all created VLANs within a switch.

The “show interface trunk” command shows encapsulation and trunking status.

The “show interfaces fastEthernet 0/1 switchport” display the status of a specific switch port. See the result on the screenshot.

Configure Inter-VLAN routing - Encapsulation Status

Configure Inter-VLAN routing – Encapsulation Status

OK, I think it’s enough for Configuring Inter-VLAN routing. I hope you find this configure Inter-VLAN routing article’s helpful and if you have any problem or question regarding this article, ask us through the comment section.


I'm a network and Information Security instructor. Here is my online pictorial notebook. I would like to write and share my experience through this website for computer enthusiasts and technology geeks.


  1. Need to enable, routing in L3 switches "ip routing".

  2. Great!!

    Dear, you explain think so good. I got it completely thanks for this effort.

  3. This example is not complete

  4. what are the IP addresses of the Pcs for each vlan?
    Sorry for my englis.

Leave a Reply