cc/td/doc/product/lan/cat6000/ios127xe
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Configuring Layer 2 Ethernet Interfaces

Configuring Layer 2 Ethernet Interfaces

This chapter describes how to use the command-line interface (CLI) to configure Ethernet, Fast Ethernet, and Gigabit Ethernet interfaces for Layer 2 switching on the Catalyst 6000 family switches. The configuration tasks in this chapter apply to Ethernet, Fast Ethernet, and Gigabit Ethernet interfaces on any module, including the uplink ports on the supervisor engine.


Note For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 6000 Family IOS Command Reference publication.

This chapter consists of these sections:


Note To configure Layer 3 interfaces, see "Configuring Layer 3 Ethernet Interfaces."

Understanding Layer 2 Switching

These sections describe how Layer 2 switching works on the Catalyst 6000 family switches:

Understanding Layer 2 Ethernet Switching Works

The Catalyst 6000 family switches support simultaneous, parallel connections between Layer 2 Ethernet segments. Switched connections between Ethernet segments last only for the duration of the packet. New connections can be made between different segments for the next packet.

The Catalyst 6000 family switches solve congestion problems caused by high-bandwidth devices and a large number of users by assigning each device (for example, a server) to its own 10-, 100-, or 1000-Mbps segment. Because each Ethernet interface on the switch represents a separate Ethernet segment, servers in a properly configured switched environment achieve full access to the bandwidth.

Because collisions are a major bottleneck in Ethernet networks, an effective solution is full-duplex communication. Normally, Ethernet operates in half-duplex mode, which means that stations can either receive or transmit. In full-duplex mode, two stations can transmit and receive at the same time. When packets can flow in both directions simultaneously, effective Ethernet bandwidth doubles to 20 Mbps for 10-Mbps interfaces and to 200 Mbps for Fast Ethernet interfaces. Gigabit Ethernet interfaces on Catalyst 6000 family switches are full duplex only, providing 2-Gbps effective bandwidth.

Switching Frames Between Segments

Each Ethernet interface on a Catalyst 6000 family switch can connect to a single workstation or server, or to a hub through which workstations or servers connect to the network.

On a typical Ethernet hub, all ports connect to a common backplane within the hub, and the bandwidth of the network is shared by all devices attached to the hub. If two stations establish a session that uses a significant level of bandwidth, the network performance of all other stations attached to the hub is degraded.

To reduce degradation, the switch treats each interface as an individual segment. When stations on different interfaces need to communicate, the switch forwards frames from one interface to the other at wire speed to ensure that each session receives full bandwidth.

To switch frames between interfaces efficiently, the switch maintains an address table. When a frame enters the switch, it associates the MAC address of the sending station with the interface on which it was received.

Building the Address Table

Catalyst 6000 family switches build the address table by using the source address of the frames received. When the switch receives a frame for a destination address not listed in its address table, it floods the frame to all interfaces of the same VLAN except the interface that received the frame. When the destination station replies, the switch adds its relevant source address and interface ID to the address table. The switch then forwards subsequent frames to a single interface without flooding to all interfaces.

The address table can store at least 16,000 address entries without flooding any entries. The switch uses an aging mechanism, defined by a configurable aging timer, so if an address remains inactive for a specified number of seconds, it is removed from the address table.

Understanding How VLAN Trunks Work

These sections describe how VLAN trunks work on the Catalyst 6000 family switches:

Trunking Overview

A trunk is a point-to-point link between one or more Ethernet switch interfaces and another networking device such as a router or a switch. Trunks carry the traffic of multiple VLANs over a single link and allow you to extend VLANs across an entire network.

Two trunking encapsulations are available on all Ethernet interfaces:

You can configure a trunk on a single Ethernet interface or on an EtherChannel bundle. For more information about EtherChannel, see "Configuring EtherChannel."

Ethernet trunk interfaces support different trunking modes (see Table 5-2). You can specify whether the trunk uses ISL encapsulation, 802.1Q encapsulation, or if the encapsulation type is autonegotiated.

To autonegotiate trunking, the interfaces must be in the same VTP domain. Use the trunk or nonegotiate keywords to force interfaces in different domains to trunk. For more information on VTP domains, see "Configuring VTP."

Trunk negotiation is managed by the Dynamic Trunking Protocol (DTP). DTP supports autonegotiation of both ISL and 802.1Q trunks.

802.1Q Trunk Restrictions

802.1Q trunks impose some limitations on the trunking strategy for a network. The following restrictions apply when using 802.1Q trunks:

When you connect a Cisco switch to a non-Cisco device through an 802.1Q trunk, the Cisco switch combines the spanning tree instance of the VLAN of the trunk with the spanning tree instance of the non-Cisco 802.1Q switch. However, spanning tree information for each VLAN is maintained by Cisco switches separated by a cloud of non-Cisco 802.1Q switches. The non-Cisco 802.1Q cloud separating the Cisco switches is treated as a single trunk link between the switches.

Encapsulation Types

Table 5-1 lists the Ethernet trunk encapsulation types.


Table 5-1: Ethernet Trunk Encapsulation Types
Encapsulation Function

switchport trunk encapsulation isl

Specifies ISL encapsulation on the trunk link.

switchport trunk encapsulation dot1q

Specifies 802.1Q encapsulation on the trunk link.

switchport trunk encapsulation negotiate

Specifies that the interface negotiate with the neighboring interface to become an ISL (preferred) or 802.1Q trunk, depending on the configuration and capabilities of the neighboring interface.

The trunking mode, the trunk encapsulation type, and the hardware capabilities of the two connected interfaces determine whether a link becomes an ISL or 802.1Q trunk.

Layer 2 Interface Modes

Table 5-2 lists the Layer 2 interface modes and describes how they function on Ethernet interfaces.


Table 5-2: Layer 2 Interface Modes
Mode Function

switchport mode access

Puts the interface into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. The interface becomes a nontrunk interface even if the neighboring interface does not agree to the change.

switchport mode dynamic desirable

Makes the interface actively attempt to convert the link to a trunk link. The interface becomes a trunk interface if the neighboring interface is set to trunk, desirable, or auto mode. This is the default mode for all Ethernet interfaces.

switchport mode dynamic auto

Makes the interface willing to convert the link to a trunk link. The interface becomes a trunk interface if the neighboring interface is set to trunk or desirable mode.

switchport mode trunk

Puts the interface into permanent trunking mode and negotiates to convert the link into a trunk link. The interface becomes a trunk interface even if the neighboring interface does not agree to the change.

switchport nonegotiate

Puts the interface into permanent trunking mode but prevents the interface from generating DTP frames. You must configure the neighboring interface manually as a trunk interface to establish a trunk link.


Note 
DTP is a point-to-point protocol. However, some internetworking devices might forward DTP frames improperly. To avoid this problem, ensure that interfaces connected to devices that do not support DTP are configured with the access keyword if you do not intend to trunk across those links. To enable trunking to a device that does not support DTP, use the nonegotiate keyword to cause the interface to become a trunk but not generate DTP frames.

Default Layer 2 Ethernet Interface Configuration

Table 5-3 shows the Layer 2 Ethernet interface default configuration.


Table 5-3: Layer 2 Ethernet Interface Default Configuration
Feature Default Value

Interface mode

switchport mode dynamic desirable

Trunk encapsulation

switchport trunk encapsulation negotiate

Allowed VLAN range

VLANs 1-1005

VLAN range eligible for pruning

VLANs 2-1001

Default VLAN (for access ports)

VLAN 1

Native VLAN (for 802.1Q trunks)

VLAN 1

Spanning Tree Protocol (STP)

Enabled for all VLANs

STP port priority

128

STP port cost

  • 100 for 10-Mbps Ethernet interfaces

  • 19 for 10/100-Mbps Fast Ethernet interfaces

  • 19 for 100-Mbps Fast Ethernet interfaces

  • 4 for 1000-Mbps Gigabit Ethernet interfaces

Configuring Ethernet Interfaces for Layer 2 Switching

These sections describe how to configure Layer 2 switching on the Catalyst 6000 family switches:

Configuring an Ethernet Interface as a Layer 2 Trunk


Note The default for Layer 2 interfaces is switchport mode dynamic desirable. 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. By default, trunks negotiate encapsulation. If the neighboring interface supports ISL and 802.1Q encapsulation and both interfaces are set to negotiate the encapsulation type, the trunk uses ISL encapsulation.

To configure an interface as a Layer 2 trunk, perform this task:
Step Command Purpose

1 . 

Router(config)# interface {ethernet | fastethernet | gigabitethernet} slot/port 

Select the interface to configure.

2 . 

Router(config-if)# shutdown 

(Optional) Shut down the interface to prevent traffic flow until configuration is complete.

3 . 

Router(config-if)# switchport 

Configure the interface for Layer 2 switching.

  • You must enter the switchport command once without any keywords to configure the interface as a Layer 2 port before you can enter additional switchport commands with keywords.

  • Required only if you have not entered the switchport command already for the interface.

4 . 

Router(config-if)# switchport trunk encapsulation {isl | dot1q | negotiate} 

(Optional) Specify the encapsulation.

Note You must enter this command with either the isl or dot1q keyword to support the switchport mode trunk command, which is not supported by the default mode (negotiate).

5 . 

Router(config-if)# switchport mode {dynamic {auto | desirable} | trunk} 

Configure the interface as a Layer 2 trunk. (Required only if the interface is a Layer 2 access port or to specify the trunking mode.)

6 . 

Router(config-if)# switchport access vlan vlan_num 

(Optional) Specify the default VLAN, which is used if the interface stops trunking.

7 . 

Router(config-if)# switchport trunk native vlan vlan_num 

For 802.1Q trunks, specify the native VLAN.

Note The default VLAN is not automatically used as the native VLAN.

8 . 

Router(config-if)# switchport trunk allowed vlan {add | except | none | remove} vlan1[,vlan[,vlan[,...]] 

(Optional) Configure the list of VLANs allowed on the trunk. All VLANs are allowed by default. You cannot remove any of the default VLANs from a trunk.

9 . 

Router(config-if)# switchport trunk pruning vlan {add | except | none | remove} vlan1[,vlan[,vlan[,...]] 

(Optional) Configure the list of VLANs allowed to be pruned from trunk (see the "Understanding VTP Pruning" section). The default list of VLANs allowed to be pruned contains all VLANs.

10 . 

Router(config-if)# no shutdown 

Activate the interface. (Required only if you shut down the interface.)

11 . 

Router(config-if)# exit 

Exit the interface configuration mode.

12 . 

Router(config)# exit 

Exit the configuration mode.

13 . 

Router# show running-config interface {ethernet | fastethernet | gigabitethernet} slot/port 

Display the running configuration of the interface.

14 . 

Router# show interfaces [ethernet | fastethernet | gigabitethernet] slot/port switchport 

Display the switchport configuration of the interface.

15 . 

Router# show interfaces [{ethernet | fastethernet | gigabitethernet} slot/port] trunk 

Display the trunk configuration of the interface.

1The vlan parameter is either a single VLAN number from 1 to 1005 or a range of VLANs described by two VLAN numbers, the lesser one first, separated by a dash. Do not enter any spaces between comma-separated vlan parameters or in dash-specified ranges.

This example shows how to configure the Fast Ethernet interface 5/8 as an 802.1Q trunk. This example assumes that the neighbor interface is configured to support 802.1Q trunking:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface fastethernet 5/8 
Router(config-if)# shutdown 
Router(config-if)# switchport 
Router(config-if)# switchport mode dynamic desirable 
Router(config-if)# switchport trunk encapsulation dot1q 
Router(config-if)# no shutdown 
Router(config-if)# exit 
Router(config)# exit 
Router# exit 
 

This example shows how to verify the configuration:

Router# show running-config interface fastethernet 5/8 
Building configuration...
Current configuration:
!
interface FastEthernet5/8
 no ip address
 switchport
 switchport trunk encapsulation dot1q
end
 
Router# show interfaces fastethernet 5/8 switchport 
Name: Fa5/8
Switchport: Enabled
Administrative Mode: dynamic desirable
Operational Mode: trunk
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Enabled
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: ALL
 
Router# show interfaces fastethernet 5/8 trunk 
 
Port      Mode         Encapsulation  Status        Native vlan
Fa5/8     desirable    n-802.1q       trunking      1
 
Port      Vlans allowed on trunk
Fa5/8 1-1005
 
Port      Vlans allowed and active in management domain
Fa5/8 1-6,10,20,50,100,152,200,300,303-305,349-351,400,500,521,524,570,801-8
02,850,917,999,1002-1005
 
Port      Vlans in spanning tree forwarding state and not pruned
Fa5/8 1-6,10,20,50,100,152,200,300,303-305,349-351,400,500,521,524,570,801-8
02,850,917,999,1002-1005
 
Router# 

Configuring an Interface as a Layer 2 Access Port


Note If you assign an interface to a VLAN that does not exist, the interface is shut down until you create the VLAN in the VLAN database (see the "Creating or Modifying an Ethernet VLAN" section).

To configure an interface as a Layer 2 access port, perform this task:
Step Command Purpose

1 . 

Router(config)# interface {ethernet | fastethernet | gigabitethernet} slot/port 

Select the interface to configure.

2 . 

Router(config-if)# shutdown 

(Optional) Shut down the interface to prevent traffic flow until configuration is complete.

3 . 

Router(config-if)# switchport 

Configure the interface for Layer 2 switching.

  • The switchport command must be entered once without any keywords to configure the interface as a Layer 2 port before you can enter additional switchport commands with keywords.

  • Required only if you have not entered the switchport command already for the interface.

4 . 

Router(config-if)# switchport mode access 

Configure the interface as a Layer 2 access port.

5 . 

Router(config-if)# switchport access vlan vlan_num 

Place the interface in a VLAN.

6 . 

Router(config-if)# no shutdown 

Activate the interface. (Required only if you shut down the interface.)

7 . 

Router(config-if)# exit 

Exit the interface configuration mode.

8 . 

Router(config)# exit 

Exit the configuration mode.

9 . 

Router# show running-config interface {ethernet | fastethernet | gigabitethernet} slot/port 

Display the running configuration of the interface.

10 . 

Router# show interfaces [{ethernet | fastethernet | gigabitethernet} slot/port] switchport 

Display the switchport configuration of the interface.

This example shows how to configure the Fast Ethernet interface 5/6 as an access port in VLAN 200:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface fastethernet 5/6 
Router(config-if)# shutdown 
Router(config-if)# switchport 
Router(config-if)# switchport mode access 
Router(config-if)# switchport access vlan 200 
Router(config-if)# no shutdown 
Router(config-if)# exit 
Router(config)# exit 
Router# exit 
 

This example shows how to verify the configuration:

Router# show running-config interface fastethernet 5/6 
Building configuration...
!
Current configuration:
interface FastEthernet5/6
 no ip address
 switchport access vlan 200
 switchport mode access
end
 
Router# show interfaces fastethernet 5/6 switchport 
Name: Fa5/6
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Enabled
Access Mode VLAN: 200 (VLAN0200)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: ALL
 
Router# 

Disabling Layer 2 Configuration

To disable Layer 2 configuration on an interface, perform this task:
Step Command Purpose

1 . 

Router(config)# interface {ethernet | fastethernet | gigabitethernet} slot/port 

Select the interface to configure.

2 . 

Router(config-if)# no switchport 

Clear Layer 2 configuration from the interface.

3 . 

Router(config-if)# exit 

Exit the interface configuration mode.

4 . 

Router(config)# exit 

Exit the configuration mode.

5 . 

Router# show running-config interface {ethernet | fastethernet | gigabitethernet} slot/port 

Display the running configuration of the interface.

6 . 

Router# show interfaces [{ethernet | fastethernet | gigabitethernet} slot/port] switchport 

Display the switchport configuration of the interface.


Note Entering a no switchport command shuts the interface down and then reenables it, which may generate messages on the device to which the interface is connected.

This example shows how to disable Layer 2 configuration on the Fast Ethernet interface 5/6:

Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# interface fastethernet 5/6 
Router(config-if)# no switchport 
Router(config-if)# exit 
Router(config)# exit 
Router# exit 
 

This example shows how to verify the configuration:

Router# show running-config interface fastethernet 5/6 
Building configuration...
Current configuration:
!
interface FastEthernet5/6
 no ip address
 no ip directed-broadcast
end
 
Router# show interfaces fastethernet 5/6 switchport 
Name: Fa5/6
Switchport: Disabled
Router# 

Note Use the default interface {ethernet | fastethernet | gigabitethernet} slot/port command to return an interface to its default configuration.


hometocprevnextglossaryfeedbacksearchhelp
Posted: Mon Jan 3 14:12:03 PST 2000
Copyright 1989-1999©Cisco Systems Inc.