Networks

VLANs, Trunking and Inter-VLAN Routing on Catalyst 9000

Updated: 25 November 2026

network switches connecting multiple VLANs
4 Minutes Read

A Configuration Guide

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. 

Step 1: Create the VLANs 

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 

Step 2: Assign Access Ports 

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. 

Step 3: Configure a Trunk 

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. 

Step 4: Enable Inter-VLAN Routing with SVIs 

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. 

Step 5: Verify 

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. 

Troubleshooting: The SVI Up/Down Gotcha 

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. 

A Note on Licensing 

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. 

Best Practices 

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. 

Frequently Asked Questions

Create the VLAN with the vlan command and name it, then assign access ports with switchport mode access and switchport access vlan. For trunk links, use switchport mode trunk and restrict the carried VLANs with switchport trunk allowed vlan. Verify with show vlan brief.
Enable routing globally with ip routing, then create a switch virtual interface for each VLAN with interface vlan , assign it an IP address, and bring it up. That SVI address is the VLAN's default gateway. The switch then routes between the VLANs in hardware. Verify with show ip route.
An SVI only comes up when at least one active access or trunk port is carrying its VLAN, even with a correct IP address. If no live port is in the VLAN, the SVI stays down. Bring a port up in that VLAN, or confirm the trunk allows it, and the SVI will come up.
No special tier for basic inter-VLAN routing. Routing between VLANs through SVIs uses connected routing, available on the Network Essentials licence. You only need Network Advantage for dynamic routing protocols such as OSPF or BGP, or for VRF and similar advanced features.
An access port carries a single VLAN and connects to an end device such as a PC or phone. A trunk port carries multiple VLANs over one link, using 802.1Q tagging, and connects switches to each other or to a router. Access ports use switchport mode access; trunks use switchport mode trunk.

Whitepapers

E-Books

Contact Us

We value the opportunity to interact with you, Please feel free to get in touch with us.

 

 

 

 

Share a few details to get started.

We'll get back to you shortly.