Interface Mode

Configure switch port modes to control how interfaces handle VLAN traffic - access ports for single VLANs or trunk ports for multiple VLANs.

Step 1: Configure access port for single VLAN Set an interface to access mode for connecting end devices like computers or phones to a specific VLAN.

1
2
3
4
5
6
7
8
SW1>enable
SW1#configure terminal
SW1(config)#interface gigabitEthernet 0/1
SW1(config-if)#description User PC - VLAN 10
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#no shutdown
SW1(config-if)#exit

Step 2: Configure trunk port for multiple VLANs Set an interface to trunk mode for connecting to other switches or devices that need to carry multiple VLAN traffic.

1
2
3
4
5
6
7
SW1(config)#interface gigabitEthernet 0/24
SW1(config-if)#description Trunk to SW2
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk native vlan 99
SW1(config-if)#switchport trunk allowed vlan 10,20,30,99
SW1(config-if)#no shutdown
SW1(config-if)#exit

Step 3: Configure voice VLAN (optional) Enable both data and voice VLANs on a single port for IP phones with built-in switches.

1
2
3
4
5
6
7
8
SW1(config)#interface gigabitEthernet 0/5
SW1(config-if)#description IP Phone + PC
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#switchport voice vlan 20
SW1(config-if)#no shutdown
SW1(config-if)#exit
SW1(config)#end

Step 4: Verify interface configuration

1
2
3
SW1#show interfaces switchport
SW1#show interfaces gigabitEthernet 0/1 switchport
SW1#show vlan brief

Key Points:

  • Access ports carry traffic for only one VLAN (untagged)
  • Trunk ports carry traffic for multiple VLANs (tagged with 802.1Q)
  • Native VLAN traffic on trunks is untagged - ensure it matches on both ends
  • Voice VLANs allow phones to tag their traffic while PC traffic remains untagged