Alpha Centauri Studies
CoursesFor Institutions

Loading...

Alpha Centauri Studies

CSEC past papers, worked

Past papers worked question by question, and courses built on the CSEC syllabus, for students across the Caribbean.

Serving Caribbean students since 2025

Explore

CoursesAboutContact

Support

PrivacyTermsHelp

Subscribe to Our Newsletter

New papers and courses, when they land.

Connect With Us
© 2026 Alpha Centauri Studies. All rights reserved.
2.1.c Inter-VLAN connectivity

TutorialLab 12112 min

Lab 121: Configuring Inter-VLAN Routing

Lab 121: Configuring Inter-VLAN Routing

In the previous exercises, we have covered the basics of VLANs and its configuration. As discussed earlier, VLANs are used to separate network traffic, enhance network security, and divide a large network in to several small networks. We know that systems belong to one VLAN cannot communicate to system belong to the other VLANs unless their VLAN name and VLAN IDs do not match. However, there is a method called Inter-VLAN routing that allows different VLANs to communicate to each other. In order to allow Inter-VLAN communication, you need a layer 3 device (router or layer 3 switch). The dot1Q encapsulation is used for the Inter-VLAN communication.

We will use the following topology to demonstrate how to configure Inter-VLAN routing. Also configure IP addresses on both the PCs as mentioned in the topology.

A Packet Tracer topology for router-on-a-stick. A 2811 router named Router1 sits at the top; its fa0/0 runs down to fa0/3 on a 2950T-24 switch named Switch0, and a callout points at that cable reading Trunk port. Switch0 carries PC0 on fa0/1 and PC1 on fa0/2, both PC-PT. Two red boxes divide the switch and its hosts into two zones labelled VLAN 10 and VLAN 20. PC0 is marked Sales 10.0.0.1 and sits in VLAN 10; PC1 is marked Account 20.0.0.1 and sits in VLAN 20. No mask or gateway is shown in the figure.

Once you have created the topology and configured IP addresses, next let’s see how to configure Inter-VLAN routing. For this, you need to perform the following configuration.

  1. On the switch, execute the following commands to configure appropriate VLANs and assign appropriate interfaces to the respective VLANs.
Switch1( config)# vlan 10
Switch1( config-vlan)# name Sales
Switch1( config-vlan)# exit
  1. Once you have configured Sales VLAN, execute the following commands to assign the Fa0/ 1 interface to Sales VLAN.
Switch1( config)# interface fa0/ 1
Switch1( config-if)# switchport mode access
Switch1( config-if)# switchport access vlan 10
Switch1( config-if)# exit
  1. Execute the following commands to create another VLAN named Account with the VLAN ID as 20.
Switch1( config)# vlan 20
Switch1( config-vlan)# name Account
Switch1( config-vlan)# exit
  1. Once you have created Account VLAN, execute the following commands to assign the Fa0/ 2 interface to Account VLAN.
Switch1( config)# interface fa0/ 2
Switch1( config-if)# switchport mode access
Switch1( config-if)# switchport access vlan 20
Switch1( config-if)# exit
  1. Next, execute the following commands to enable VLAN trunking on the Fa0/ 3 interface.
Switch1( config)# interface fa0/ 3
Switch1( config-if)# switchport mode trunk
Switch1( config-if)# exit
  1. After configuring VLANs and VLAN trunking on switch, configure the following TCP/ IP settings on PC0:

IP address: 10.0.0.1 Subnet mask: 255.0.0.0 Default gateway: 10.0.0.100

The Desktop IP Configuration window of PC0 in Packet Tracer. Under IP Configuration the Static radio button is selected rather than DHCP. IP Address is 10.0.0.1, Subnet Mask is 255.0.0.0, and Default Gateway is 10.0.0.100, highlighted in yellow because it is the router subinterface the lab has just created. DNS Server is empty. Under IPv6 Configuration the Static radio button is selected rather than DHCP or Auto Config; IPv6 Address is empty, Link Local Address reads FE80::20C:85FF:FE23:EAEA, and IPv6 Gateway and IPv6 DNS Server are both empty.

  1. Next, configure the following TCP/ IP settings on PC1:

IP address: 20.0.0.1 Subnet mask: 255.0.0.0 Default gateway: 20.0.0.100

  1. Once you have configured appropriate TCP/ IP settings on PC0 and PC1, move to Router. On Router, execute the following command to enable its Fa0/ 0 interface.
Router( config)# interface fa0/ 0
Router( config-if)# no ip address
Router( config-if)# no shutdown
Router( config-if)# exit
  1. On Router, execute the following commands to enable the dot1q encapsulation protocol (along with the VLAN ID) and to configure 10.0.0.100/ 8 IP address on its fa0/ 0.10 virtual sub-interface.
Router( config)# interface fa0/ 0.10
Router( config-subif)# encapsulation dot1q 10
Router( config-subif)# ip address 10.0.0.100 255.0.0.0
Router( config-subif)# exit
  1. On Router, execute the following commands to enable the dot1q encapsulation protocol (along with the VLAN ID) and to configure 20.0.0.100/ 8 IP address on its fa0/ 0.20 virtual sub-interface.
Router( config)# interface fa0/ 0.20
Router( config-subif)# encapsulation dot1q 20
Router( config-subif)# ip address 20.0.0.100 255.0.0.0
Router( config-subif)# exit
  1. Next, execute the following commands to configure the RIP routing (or any other depending on your choice) on Router.
Router( config)# router rip
Router( config-router)# network 10.0.0.0
Router( config-router)# network 20.0.0.0
Router( config)# exit
  1. The following figure displays the Inter-VLAN configuration on Router.

The router-on-a-stick configuration on Router1, in three annotated groups. Configuring physical interface: int fa0/0, no ip address, no shutdown. Configuring sub-interfaces: int fa0/0.10 with encapsulation dot1q 10 and ip add 10.0.0.100 255.0.0.0, then int fa0/0.20 with encapsulation dot1q 20 and ip add 20.0.0.100 255.0.0.0, with %LINK-5-CHANGED and %LINEPROTO-5-UPDOWN messages for FastEthernet0/0.20 changing state to up in between. Configuring routing: router rip, network 10.0.0.0, network 20.0.0.0, exit. The transcript ends at Router(config)#. The prompt stays Router throughout, the hostname is never changed.

  1. That’s all you need to configure for Inter-VLAN routing. Now, it’s time to verify your configuration. To do so, open Command Prompt on PC1, type the following commands to check the connectivity to PC0.

Tracert 10.0.0.1 Ping 10.0.0.1

  1. You should be able to communicate to PC0 even both the PCs belong to different subnets and VLANs.

A Command Prompt on PC1 proving inter-VLAN routing works. tracert 10.0.0.1 traces over a maximum of 30 hops and returns two hops: hop 1 is 20.0.0.100 with times 0 ms, 4 ms and 0 ms, which is the router subinterface serving PC1's own VLAN, and hop 2 is 10.0.0.1 with 0 ms, 0 ms and 0 ms, which is the destination. Trace complete. ping 10.0.0.1 then returns four replies, bytes=32 and TTL=127 on each, with times 1ms, 1ms, 0ms and 0ms, and statistics of Sent = 4, Received = 4, Lost = 0 (0% loss), Minimum = 0ms, Maximum = 1ms, Average = 0ms. The TTL of 127 rather than 128 is the hop through the router.

Source: itexamanswers.net