Updated: 25 November 2026
Three building blocks turn a Catalyst 9000 from a flat switch into a segmented, routed network. VLANs divide it into separate broadcast domains. Trunks carry several VLANs between switches over one link. And inter-VLAN routing lets those VLANs talk to each other, all on the same Layer 3 switch, no external router needed. Here's how to configure each, in order, with the commands.
Define the VLANs and give them names, so the config is readable later:
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name VOICE
Switch(config-vlan)# exit
Switch(config)# vlan 30
Switch(config-vlan)# name GUEST
Switch(config-vlan)# exit
Put the endpoint-facing ports into their VLANs. switchport mode access fixes the port as an access port, and switchport access vlan sets which VLAN it belongs to. For desks with IP phones, add a voice VLAN so the phone and the PC behind it share one port:
Switch(config)# interface range GigabitEthernet1/0/1-24
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# switchport voice vlan 20
Switch(config-if-range)# spanning-tree portfast
Switch(config-if-range)# exit
spanning-tree portfast brings access ports up immediately for end devices, don't apply it to switch-to-switch links.
The uplink to another switch needs to carry multiple VLANs, so make it a trunk. Set the mode, restrict the allowed VLANs to only those the link needs, change the native VLAN away from the default 1, and disable dynamic negotiation:
Switch(config)# interface GigabitEthernet1/0/48
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20,30
Switch(config-if)# switchport trunk native vlan 99
Switch(config-if)# switchport nonegotiate
Switch(config-if)# exit
Two of these are security and hygiene, not just function. Pruning the allowed VLANs stops traffic you don't intend from crossing the trunk, and changing the native VLAN off VLAN 1 closes a common attack path. switchport nonegotiate turns off DTP so the port doesn't auto-negotiate its mode.
For the VLANs to talk to each other, the switch has to route between them. First enable IP routing globally, then create a switch virtual interface (SVI) for each VLAN and give it an IP address, that address becomes the default gateway for devices in that VLAN:
Switch(config)# ip routing
Switch(config)# interface vlan 10
Switch(config-if)# ip address 10.10.10.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
Switch(config)# interface vlan 20
Switch(config-if)# ip address 10.10.20.1 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit
The IP routing command is the one people forget, without it the SVIs come up but the switch won't route between them. With it, the switch installs connected routes for each SVI subnet and forwards traffic between VLANs in hardware.
Point each endpoint's default gateway at its SVI address (10.10.10.1 for VLAN 10, and so on), and inter-VLAN traffic now flows through the switch.
Confirm the pieces:
Switch# show vlan brief
Switch# show interfaces trunk
Switch# show ip interface brief
Switch# show ip route
show vlan brief lists your VLANs and which ports are in them. show interfaces trunk confirms the trunk is up and which VLANs it carries. show ip interface brief shows each SVI with its address and status. show ip route should list a connected route for each SVI subnet, once you see those, ping between a device in VLAN 10 and one in VLAN 20 to prove routing works.
If an SVI shows up/down despite a correct IP, this is almost always why: an SVI only comes up when at least one active access or trunk port is carrying that VLAN. Configure the address perfectly, but if no live port is in the VLAN, the SVI stays down. Bring a port up in the VLAN, or confirm the trunk actually allows it, and the SVI comes up.
The other common culprits are a native VLAN mismatch between the two ends of a trunk, and a VLAN pruned out of the trunk's allowed list, so check show interfaces trunk on both switches when traffic won't cross.
Inter-VLAN routing through SVIs uses connected routing, which is available on the Network Essentials licence, so a standard access switch can route between its VLANs without the higher tier. You only need Network Advantage when you move to dynamic routing protocols like OSPF or BGP, or features such as VRF. For basic inter-VLAN routing, Essentials is enough.
A few habits keep the config clean and secure: don't use VLAN 1 for user traffic or management; prune trunk allowed-VLAN lists to only what each link needs; change the native VLAN off 1 and match it on both ends; disable DTP with switchport nonegotiate; and keep one subnet per VLAN so the addressing stays sane. None of these change what works, but they're the difference between a tidy network and one that's hard to secure and troubleshoot later.
We'll get back to you shortly.