Basic VLANs
In this lab, we’ll connect different VLANs using a Layer 3 switch, without a separate router.
Get no Shut Network’s stories in your inbox
Join Medium for free to get updates from this writer.
A Layer 3 switch uses SVIs (Switch Virtual Interfaces) as gateways to route traffic between VLANs.
1. Network Topology
Devices:
- 1 Layer 3 switch (Cisco 3560)
- 3 Layer 2 switches (Cisco 2960)
- 3 PCs and 1 Server
IP Addressing:
- VLAN 10 — PC1:
10.1.10.10/24| GW:10.1.10.254 - VLAN 20 — PC2:
10.1.20.20/24| GW:10.1.20.254 - VLAN 30 — PC3:
10.1.30.30/24| GW:10.1.30.254 - VLAN 100 — Server:
10.1.100.100/24| GW:10.1.100.254
Switch Management (VLAN 1):
- L3-SW:
10.1.1.254 - SW1:
10.1.1.1 - SW2:
10.1.1.2 - SW3:
10.1.1.3
2. Layer 3 Switch Configuration
Create VLANs, configure their gateways, enable routing, and configure trunk ports.
enable
configure terminal
hostname L3-SWvlan 10
vlan 20
vlan 30
vlan 100
exitip routinginterface Vlan1
ip address 10.1.1.254 255.255.255.0
no shutdown
exitinterface Vlan10
ip address 10.1.10.254 255.255.255.0
no shutdown
exitinterface Vlan20
ip address 10.1.20.254 255.255.255.0
no shutdown
exitinterface Vlan30
ip address 10.1.30.254 255.255.255.0
no shutdown
exitinterface Vlan100
ip address 10.1.100.254 255.255.255.0
no shutdown
exitinterface range GigabitEthernet1/0/1 - 3
switchport mode trunk
exitinterface GigabitEthernet1/0/20
switchport mode access
switchport access vlan 100
exitend
write memory
Key command: ip routing enables routing between the VLANs.
3. SW1 Configuration — VLAN 10
enable
configure terminal
hostname SW1vlan 10
exitinterface FastEthernet0/1
switchport mode access
switchport access vlan 10
exitinterface GigabitEthernet0/1
switchport mode trunk
exitinterface Vlan1
ip address 10.1.1.1 255.255.255.0
no shutdown
exitip default-gateway 10.1.1.254end
write memory
4. SW2 Configuration — VLAN 20
enable
configure terminal
hostname SW2vlan 20
exitinterface FastEthernet0/1
switchport mode access
switchport access vlan 20
exitinterface GigabitEthernet0/1
switchport mode trunk
exitinterface Vlan1
ip address 10.1.1.2 255.255.255.0
no shutdown
exitip default-gateway 10.1.1.254end
write memory
5. SW3 Configuration — VLAN 30
enable
configure terminal
hostname SW3vlan 30
exitinterface FastEthernet0/1
switchport mode access
switchport access vlan 30
exitinterface GigabitEthernet0/1
switchport mode trunk
exitinterface Vlan1
ip address 10.1.1.3 255.255.255.0
no shutdown
exitip default-gateway 10.1.1.254end
write memory
Note:
- Access ports connect end devices to their VLANs.
- Trunk ports carry VLAN traffic between switches.
- SVIs act as default gateways.
ip default-gatewayon the Layer 2 switches is for management traffic.
6. Verification
On L3-SW:
show vlan brief
show interfaces trunk
show ip interface brief
show ip routeCheck that the VLAN interfaces are up/up and that the VLAN networks appear as connected routes.
7. Testing Connectivity
From PC1, test communication with the other VLANs:
ping 10.1.20.20
ping 10.1.30.30
ping 10.1.100.100Test switch management connectivity:
ping 10.1.1.254Expected result: All pings succeed when the VLANs, trunks, gateways, and routing are correctly configured.
Conclusion
We configured Inter-VLAN Routing using a Layer 3 switch with VLANs, access ports, trunk ports, SVIs, and ip routing.
Unlike Router-on-a-Stick, no separate router is required.
💡 Want to try it yourself? Every topology diagram and Cisco CLI simulation in this article was built right in the browser using PingMyNetwork. Whether you’re studying for your CCNA or just diving into networking fundamentals, head over to PingMyNetwork.com to explore, build, and test your own interactive labs!






