Computer Networks

[Day 9] 7. Inter-VLAN Connection

D
DITISS Admin
••2 min read

Inter-VLAN Routing (Router-on-a-Stick Configuration)

Explanation:

Inter-VLAN routing is necessary when devices in different VLANs need to communicate. This is achieved by using a router to route traffic between VLANs. A common method for implementing this is known as Router-on-a-Stick.

In a Router-on-a-Stick configuration, the router uses a single physical interface (such as FastEthernet 0/0) to handle traffic for multiple VLANs. To enable this, we create sub-interfaces on the router, each of which is associated with a specific VLAN.

  • Each sub-interface acts as a virtual interface for a particular VLAN.
  • Sub-interfaces allow the router to communicate with multiple VLANs through a single physical interface.
  • The VLAN information is encapsulated (tagged) using 802.1Q or ISL.

Router Configuration Steps:

  1. Create a sub-interface for the desired VLAN:

    bash
    R1(config)# int fa0.2
    
  2. Assign an IP address to the sub-interface (for the corresponding VLAN):

    bash
    R1(config-if)# ip address 172.16.10.1 255.255.255.0
    
  3. Configure encapsulation for the VLAN (using 802.1Q or ISL):

    • For 802.1Q:

      bash
      R1(config-if)# encapsulation dot1q 2
      
    • For ISL:

      bash
      R1(config-if)# encapsulation isl 2
      

Monitoring Commands:

  1. show vlan
    : Displays information about the VLANs configured on the switch.

  2. show vlan brief
    : Shows a concise summary of the VLANs on the switch.

  3. show int trunk
    : Displays trunk link status and VLANs allowed on trunk interfaces.

  4. show mac-address table
    : Lists the MAC addresses learned on each switch port.

  5. show vtp status
    : Displays the status of the VTP (VLAN Trunking Protocol) on the switch, including domain name and mode.


Read Next

8/26/2026

[Day 9] 8. IPv4 Header

### **Breakdown of an IPv4 Header (20 bytes)** 1. **Version (4 bits)**: - Specifies the IP version (IPv4 = 4, IPv6 = 6). - **Size**...

8/26/2026

[Day 10] 1. Access Control List (ACL)

An **Access Control List (ACL)** is a set of rules configured on a router to filter and control the flow of network traffic based on specified criteri...