14-19
Catalyst 2950 Desktop Switch Software Configuration Guide
78-14982-01
Chapter 14 Configuring VLA Ns Configurin g VLAN Trunks
This exam pl e shows how to c on figure t he Fast E the rne t i nte rface 0 /4 as a n 802 .1 Q t run k. Th e exam pl e
assumes th at the nei ghbor int erface is configure d to support 80 2.1Q trunki ng.
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet0/4
Switch(config-if)# switchport mode dynamic desirable
Switch(config-if)# end

Defining the Allowed VLANs on a Trunk

By default, a trunk port sends traffic to and receives traffic from all VLANs. All VLAN IDs, 1 to 4094
when t he EI is installe d, and 1 to 1005 w hen the SI is installe d, are allo we d on each trun k. Ho wever, you
can remove VLAN s from the al lowed list, preventing traffic from those VLANs fr om passing over the
trunk. To restrict the traffic a trunk carries, use the switchport trunk allowed vlan remove vlan-list
interface configuration command to remove specific VLANs from the allowed list.
Note You ca nnot rem ove VLAN 1 or V LAN s 100 2 to 10 05 fr om t he a ll owed VLAN lis t.
A trunk port can become a member of a VLAN if the VLAN is enabled, if VTP knows of the VLAN,
and if the VLAN is in the allowed list for the po rt. When VTP detects a newly enabled VLAN and the
VLAN is in the allowed list for a trunk port, the trunk port automatically becomes a member of the
enabled VLAN. Wh en VTP detects a new VLAN and the VLAN is not in the allowed list for a trunk
port, the t runk port does not become a member of the new VLAN.
Beginning in privileged EXEC mo de, foll ow these s teps to modif y the allowed list of an 802. 1Q trunk:
To return to the default allowed VLAN list of all VLANs, use the no switchport trunk allowed vlan
interface configuration command.
Command Purpose
Step 1 configure terminal Enter globa l configurati on mode.
Step 2 interface interface-id Enter interfac e configurati on mode and the port to be configured.
Step 3 switchport mode trunk Configure the interface as a VLAN trunk port.
Step 4 switchport trunk allowed vlan {add |
all | except | remove} vlan- list (Optional) Configure the list of VLANs allowed on the trunk.
For explanations about using the add, all, except, and remove keywords,
refer t o the co mm and re fe renc e fo r t his r ele as e.
The vlan-list paramete r is e ith er a si ngle VLAN num ber f rom 1 to 4 094
or a range of V LANs desc ribed by two VLA N numbers, the lower one
first, separa te d by a hy phe n. D o not en ter any s pace s b etw een
comma-s epa rat ed V LA N pa ra met ers o r in hyp he n-s peci fied ra nges.
All VLANs are allowed by default. You cannot remove any of the default
VLANs (1 o r 1 002 to 100 5) fr om a tru nk.
Step 5 end Return to p rivileged EXEC mode.
Step 6 show interfaces interface-id switchport Verify your entries in the Trunking VLA Ns Enable d field of the display.
Step 7 copy running-config startup-config (Optiona l) Save your entries in the co nfigurati on file.