Sitemap
no Shut Network

no Shut Network

Basic VLANs

3 min readOct 28, 2026

--

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

Press enter or click to view image in full size

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-SW
vlan 10
vlan 20
vlan 30
vlan 100
exit
ip routinginterface Vlan1
ip address 10.1.1.254 255.255.255.0
no shutdown
exit
interface Vlan10
ip address 10.1.10.254 255.255.255.0
no shutdown
exit
interface Vlan20
ip address 10.1.20.254 255.255.255.0
no shutdown
exit
interface Vlan30
ip address 10.1.30.254 255.255.255.0
no shutdown
exit
interface Vlan100
ip address 10.1.100.254 255.255.255.0
no shutdown
exit
interface range GigabitEthernet1/0/1 - 3
switchport mode trunk
exit
interface GigabitEthernet1/0/20
switchport mode access
switchport access vlan 100
exit
end
write memory

Key command: ip routing enables routing between the VLANs.

3. SW1 Configuration — VLAN 10

enable
configure terminal
hostname SW1
vlan 10
exit
interface FastEthernet0/1
switchport mode access
switchport access vlan 10
exit
interface GigabitEthernet0/1
switchport mode trunk
exit
interface Vlan1
ip address 10.1.1.1 255.255.255.0
no shutdown
exit
ip default-gateway 10.1.1.254end
write memory

4. SW2 Configuration — VLAN 20

enable
configure terminal
hostname SW2
vlan 20
exit
interface FastEthernet0/1
switchport mode access
switchport access vlan 20
exit
interface GigabitEthernet0/1
switchport mode trunk
exit
interface Vlan1
ip address 10.1.1.2 255.255.255.0
no shutdown
exit
ip default-gateway 10.1.1.254end
write memory

5. SW3 Configuration — VLAN 30

enable
configure terminal
hostname SW3
vlan 30
exit
interface FastEthernet0/1
switchport mode access
switchport access vlan 30
exit
interface GigabitEthernet0/1
switchport mode trunk
exit
interface Vlan1
ip address 10.1.1.3 255.255.255.0
no shutdown
exit
ip 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-gateway on 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 route

Check 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.100

Test switch management connectivity:

ping 10.1.1.254

Expected 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!

--

--