Free CCNA | VLANs (Part 2) | Day 17 Lab | CCNA 200-301 Complete Course

3 min read 3 months ago
Published on Nov 25, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

In this tutorial, we will walk through the process of configuring access and trunk ports on a Cisco switch and setting up inter-VLAN routing using a router on a stick (ROAS). This guide is designed for CCNA students and anyone interested in learning about VLANs and inter-VLAN communication. By the end, you'll have a solid understanding of how to implement these network configurations.

Step 1: Configure Access Ports

  • Identify Switch Ports: Determine which ports on the switch will be designated as access ports.
  • Access Port Configuration:
    1. Access the switch's command line interface (CLI).
    2. Enter global configuration mode:
      enable
      configure terminal
      
    3. Select the interface you want to configure:
      interface FastEthernet0/1  # Example port
      
    4. Set the port as an access port:
      switchport mode access
      
    5. Assign the port to a VLAN:
      switchport access vlan 10  # Example VLAN
      
    6. Repeat for each access port needed.

Step 2: Configure Trunk Ports

  • Identify Trunk Ports: Determine which ports on the switch will carry traffic for multiple VLANs.
  • Trunk Port Configuration:
    1. Still in the CLI, select the trunk interface:
      interface FastEthernet0/24  # Example trunk port
      
    2. Set the port to trunk mode:
      switchport mode trunk
      
    3. Specify allowed VLANs on the trunk:
      switchport trunk allowed vlan 10,20,30  # Example allowed VLANs
      

Step 3: Configure Inter-VLAN Routing

  • Router Setup: Ensure you have a router connected to the switch for inter-VLAN routing.
  • Router on a Stick Configuration:
    1. Access the router's CLI.
    2. Enter global configuration mode:
      enable
      configure terminal
      
    3. Create sub-interfaces for each VLAN:
      interface GigabitEthernet0/1.10
      encapsulation dot1Q 10
      ip address 192.168.10.1 255.255.255.0  # Example IP for VLAN 10
      
      interface GigabitEthernet0/1.20
      encapsulation dot1Q 20
      ip address 192.168.20.1 255.255.255.0  # Example IP for VLAN 20
      
    4. Enable the main interface:
      interface GigabitEthernet0/1
      no shutdown
      

Step 4: Test Configuration

  • Verify VLANs: Use the following command on the switch to check VLAN configuration:
    show vlan brief
    
  • Test Connectivity: From a device in each VLAN, attempt to ping the router's sub-interface IP addresses to ensure inter-VLAN routing is working.

Conclusion

In this tutorial, we covered the essential steps to configure access and trunk ports on a Cisco switch and set up inter-VLAN routing using a router on a stick configuration. With these skills, you can effectively manage VLANs and enable communication across them. As a next step, explore more advanced routing protocols or practice with various VLAN configurations to deepen your understanding.