Free CCNA | VLANs (Part 2) | Day 17 Lab | CCNA 200-301 Complete Course
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:
- Access the switch's command line interface (CLI).
- Enter global configuration mode:
enable configure terminal - Select the interface you want to configure:
interface FastEthernet0/1 # Example port - Set the port as an access port:
switchport mode access - Assign the port to a VLAN:
switchport access vlan 10 # Example VLAN - 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:
- Still in the CLI, select the trunk interface:
interface FastEthernet0/24 # Example trunk port - Set the port to trunk mode:
switchport mode trunk - Specify allowed VLANs on the trunk:
switchport trunk allowed vlan 10,20,30 # Example allowed VLANs
- Still in the CLI, select the trunk interface:
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:
- Access the router's CLI.
- Enter global configuration mode:
enable configure terminal - 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 - 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.