Home > Articles > Cisco

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Configuring Voice VLANs

This and the following sections define how VoIP and data traffic can use the same physical link while operating on separate Layer 2 VLANs. Figure 7.2 shows the PC communicating using untagged frames on VLAN 12 and the IP phone communicating on VLAN 112 with 802.1Q frames. The VLANs are configured on the infrastructure switch, as shown in Figure 7.1.

Figure 7.2

Figure 7.2 Voice and data VLANs coexist on a single physical connection.

Listing 7.1 shows a sample switch port configuration.

Listing 7.1. Switch Port Configuration

Switch(config)# interface FastEthernet0/1
Switch(config-if)# switchport access vlan 12
Switch(config-if)# switchport mode access
Switch(config-if)# switchport voice vlan 112
Switch(config-if)# spanning-tree portfast

The switchport access vlan command statically configures the access VLAN for the PC traffic.

The switchport mode access command statically configures the port in access mode.

The switchport voice vlan vlan-id command identifies the VLAN provided by the switch to the Cisco IP phone using CDP so that the Cisco IP phone can insert the voice VLAN ID and the 802.1P class of service (CoS) values for the VoIP control and media frames. By default, the IP phone sets the CoS setting in the 802.1Q header to a priority of 5 for voice streaming traffic and a priority of 3 for the call control traffic.

The spanning-tree portfast command eliminates the normal 30- to 50-second spanning tree delay before traffic is forwarded on a switch port.

You can verify your voice VLAN configuration on the Cisco Catalyst switch using the show interface mod/port switchport command, as shown in Listing 7.2.

Listing 7.2. Using the show interface mod/port switchport Command

Switch# show interface fa0/17 switchport

Name: Fa0/17Switchport: Enabled
Administrative mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 12 (VLAN0012)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: 112 (VLAN0112)
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Appliance trust: none

For IP communications to access the voice and data VLANs, you need to provide a Layer 3 IP interface. There are three methods used to provide this access: an external router connected to a switch, a Layer 3 switch, and a router with built-in switch ports.

VLANs and an External Router

The commands used to connect an external router to access the voice and data VLANs created in the preceding section follow in Listing 7.3.

Listing 7.3. External Router—Layer 3 VLAN Configuration

CMErouter(config)# interface fa0/0.12
CMErouter(config-if)# encapsulation dot1q 12
CMErouter(config-if)# ip address
CMErouter(config)# interface fa0/0.112
CMErouter(config-if)# encapsulation dot1q 112
CMErouter(config-if)# ip address

Router with Built-in Switch Ports

Listing 7.4 shows the commands used to connect a Layer 3 switch or a router with internal switch ports to access the voice and data VLANs created previously.

Listing 7.4. Router with Built-in Switch—Layer 3 VLAN Configuration

CMErouter(config)# interface vlan 12
CMErouter(config-if)# ip address
CMErouter(config)# interface vlan 112
CMErouter(config-if)# ip address
  • + Share This
  • 🔖 Save To Your Account