
White Paper
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 20 of 51
IOS(Config-if)# switchport access vlan 2
IOS(Config-if)# no shut
IOS(Config-if)# end
Trunk Switchport
Trunk switchports in Cisco IOS Software are Layer 2 ports that carry multiple VLANs using ISL or
IEEE 802.1q encapsulations. They are fully compatible with any other device supporting the ISL or
IEEE 802.1q protocols.
After converting a routed interface to a Layer 2 switchport, the switchport will default to switchport
mode dynamic desirable. The port is capable of forming a trunk with a neighboring Layer 2 device
by using DTP for negotiating a trunk. If the neighboring interface supports trunking and is
configured to allow trunking, the link becomes a Layer 2 trunk when you enter the switchport
command (because of the dynamic/desirable default). By default, trunks negotiate encapsulation.
If the neighboring interface supports both ISL and IEEE 802.1q encapsulation and both interfaces
are set to negotiate the encapsulation type, the trunk will use ISL encapsulation. This is the same
operation as in the Cisco Catalyst OS. The following example shows how to configure a trunk for
IEEE 802.1q encapsulation:
IOS# configure terminal
IOS(Config)# interface fastethernet 5/1
IOS(Config-if)# switchport
IOS(Config-if)# switchport trunk encapsulation dot1q
IOS(Config-if)# end
For details on the different trunk negotiation states, refer to the Cisco IOS Software Configuration
Guide at
http://www.cisco.com/univercd/cc/td/doc/product/lan/cat6000/12_1e/swconfig/layer2.htm.
Note: Recommended configuration for a dynamic trunk port would be desirable/auto between
neighboring devices.
The switchport trunk native vlan <vlan-id> command sets the native VLAN for an IEEE 802.1q
trunk port. The allowed parameter can be used to control the VLANs that are forwarded out that
interface. In addition, the pruning parameter can be used to control VTP pruning on the link.
VLAN1 cannot be pruned, either in the Cisco Catalyst OS or in Cisco IOS Software. However, both
Cisco IOS Software and the Cisco Catalyst OS allow VLAN1 to be disabled from carrying traffic on
trunks.
If a no switchport command is offered, all the commands related to that switchport will no longer
show in configuration and the interface type will revert to a routed interface. However, if the
switchport is reenabled, then all the previous switchport-related commands will still be reinstated.
3
Cisco IOS Software Interface Configuration: Range Command
All interface types, whether routed interfaces, SVIs, or switchports, can be configured in groups.
This means you can apply configuration parameters to a group of ports at once. The Cisco IOS
Software range command allows you to configure multiple interfaces simultaneously by specifying
interface range and then the range of ports. The ports in the range can be discontinuous across
the same or different line cards. The following is a sample range configuration:
3
This applies to a system that has not been rebooted since doing the “no switchport” command.
Comentarios a estos manuales