Configuring a Trunk Port
This section describes how to use the CLI to configure an ISL or IEEE 802.1Q trunk port, how to define the VLANs that can use a port, and how to disable a trunk port.
If you are assigning a port on a cluster member switch to a VLAN, first log in to the member switch by using the privileged EXEC rcommand command. See the Cisco IOS Desktop Switching Command Reference for more information on how to use this command.
To define a port as an ISL trunk port, perform this task from privileged EXEC mode:
Task | Command |
---|---|
Step 1 Enter global configuration mode. | configure terminal |
Step 2 Enter the interface configuration command mode and the port to be added to the VLAN. | interface interface_id |
Step 3 Configure the port with a VLAN membership mode of trunk. | switchport mode trunk |
Step 4 1 Configure the port to support ISL trunking. | switchport trunk encapsulation isl |
Step 5 Return to privileged EXEC mode. | end |
Step 6 Verify your entries. | show interface interface-id switchport |
Step 7 Save the configuration. | copy running-config startup-config |
This example shows how to configure a port as a trunk, verify the trunk configuration, and save the change to the startup configuration file:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation isl
Switch(config-if)# end
Switch# show interface fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Operational Mode: trunk
Administrative Trunking Encapsulation: isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: 1-3,1002-1005
Trunking VLANs Active: 1-3
Pruning VLANs Enabled: NONE
Defining the Allowed VLANs on a Trunk
A trunk port by default sends to and receives traffic from all VLANs in the VLAN database. All VLANs, 1 to 1005, are allowed on each trunk. However, you can remove VLANs from the allowed list, preventing traffic from those VLANs from passing over the trunk. To restrict the traffic a trunk carries, use the remove vlan-list parameter to remove specific VLANs from the allowed list.
To modify the allowed list of a trunk, perform this task from privileged EXEC mode:
This example shows how to define the allowed VLANs list for trunk port Fa0/1 to allow VLANs 1 to 100, VLAN 250, and VLANs 500 to 1005, and how to verify the allowed VLAN list for the trunk:
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan remove 101-499
Switch(config-if)# switchport trunk allowed vlan add 250
Switch(config-if)# end
Switch# show interface fa0/1 switchport allowed-vlan
Switch#
Disabling a Trunk Port
You can disable trunking on a port by returning it to its default static-access mode. To disable trunking on a port, perform the following tasks from privileged EXEC mode:
This example shows how to disable trunking on a port:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fa0/1
Switch(config-if)# no switchport mode
Switch(config-if)# end
Switch# show interface fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative mode: static access
Administrative Trunking Encapsulation: isl
Operational Trunking Encapsulation: isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: NONE
Pruning VLANs Enabled: NONE