Table Of Contents
Configuring Interfaces
Overview of Interface Configuration
Using the interface Command
Configuring a Range of Interfaces
Defining and Using Interface-Range Macros
Configuring Optional Interface Features
Speed and Duplex Mode Configuration Guidelines
Setting the Interface Speed
Setting the Interface Duplex Mode
Displaying the Interface Speed and Duplex Mode Configuration
Adding a Description for an Interface
Understanding Online Insertion and Removal
Monitoring and Maintaining the Interface
Monitoring Interface and Controller Status
Clearing and Resetting the Interface
Shutting Down and Restarting an Interface
Configuring Interfaces
This chapter describes how to configure interfaces for the Catalyst 4000 family switches. It also provides guidelines, procedures, and configuration examples.
This chapter includes the following major sections:
•
Overview of Interface Configuration
•
Using the interface Command
•
Configuring a Range of Interfaces
•
Defining and Using Interface-Range Macros
•
Configuring Optional Interface Features
•
Understanding Online Insertion and Removal
•
Monitoring and Maintaining the Interface
Note
For complete syntax and usage information for the switch commands used in this chapter, refer to the Cisco IOS Command Reference for the Catalyst 4000 Family Switch and related publications at
http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/index.htm.
Overview of Interface Configuration
By default, all interfaces are enabled. The 10/100-Mbps Ethernet interfaces autonegotiate connection speed and duplex. The 10/100/1000-Mbps Ethernet interfaces negotiate speed, duplex, and flow control. The 1000-Mbps Ethernet interfaces negotiate flow control only. Autonegotiation automatically selects the fastest speed possible on that port for the given pair. If a speed is explicitly stated for an interface, that interface will default to half duplex unless it is explicitly set for full duplex.
Many features are enabled on a per-interface basis. When you enter the interface command, you must specify the following:
•
Interface type:
–
Fast Ethernet (use the fastethernet keyword)
–
Gigabit Ethernet (use the gigabitethernet keyword)
•
Slot number—The slot in which the interface module is installed. Slots are numbered starting with 1, from top to bottom.
•
Interface number—The interface number on the module. The interface numbers always begin with 1. When you are facing the front of the switch, the interfaces are numbered from left to right.
You can identify interfaces by physically checking the slot/interface location on the switch. You can also use the Cisco IOS show commands to display information about a specific interface or all the interfaces.
Using the interface Command
These general instructions apply to all interface configuration processes.
Step 1
At the privileged EXEC prompt, enter the configure terminal command to enter global configuration mode:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Step 2
In global configuration mode, enter the interface command. Identify the interface type and the number of the connector on the interface card. The following example shows how to select Fast Ethernet, slot 5, interface 1:
Switch(config)# interface fastethernet 5/1
Step 3
Interface numbers are assigned at the factory at the time of installation or when modules are added to a system. Enter the show interfaces EXEC command to see a list of all interfaces installed on your switch. A report is provided for each interface that your switch supports, as shown in this display:
Vlan1 is up, line protocol is down
Hardware is Ethernet SVI, address is 0004.dd46.7aff (bia 0004.dd46.7aff)
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 interface resets
0 output buffer failures, 0 output buffers swapped out
GigabitEthernet1/1 is up, line protocol is down
Hardware is Gigabit Ethernet Port, address is 0004.dd46.7700 (bia 0004.dd46.7700)
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
GigabitEthernet1/2 is up, line protocol is down
Hardware is Gigabit Ethernet Port, address is 0004.dd46.7701 (bia 0004.dd46.7701)
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Step 4
To begin configuring Fast Ethernet interface 5/5, as shown in the following example, enter the interface keyword, interface type, slot number, and interface number in global configuration mode:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet 5/5
Note
You do not need to add a space between the interface type and interface number. For example, in the preceding line you can specify either fastethernet 5/5 or fastethernet5/5.
Step 5
Follow each interface command with the interface configuration commands your particular interface requires. The commands you enter define the protocols and applications that will run on the interface. The commands are collected and applied to the interface command until you enter another interface command or press Ctrl-Z to exit interface configuration mode and return to privileged EXEC mode.
Step 6
After you configure an interface, check its status by using the EXEC show commands listed in "Monitoring and Maintaining the Interface" section.
Configuring a Range of Interfaces
The interface-range configuration mode allows you to configure multiple interfaces with the same configuration parameters. When you enter the interface-range configuration mode, all command parameters you enter are attributed to all interfaces within that range until you exit interface-range configuration mode.
To configure a range of interfaces with the same configuration, enter this command:
Command
|
Task
|
Switch(config)# interface range
{vlan vlan_ID - vlan_ID} |
{{fastethernet | gigabitethernet | macro
macro_name} slot/interface - interface}
[, {vlan vlan_ID - vlan_ID}
{{fastethernet | gigabitethernet | macro
macro_name} slot/interface - interface}]
|
Selects the range of interfaces to be configured. Note the following:
• You are required to enter a space before the dash.
• You can enter up to five comma-separated ranges.
• You are not required to enter spaces before or after the comma.
|
Note
When you use the interface range command, you must add a space between the vlan, fastethernet, gigabitethernet, or macro keyword and the dash. For example, the command interface range fastethernet 5/1 - 5 specifies a valid range; the command interface range fastethernet 1-5 does not contain a valid range command.
Note
The interface range command works only with VLAN interfaces that have been configured with the interface vlan command (the show running-configuration command displays the configured VLAN interfaces). VLAN interfaces that are not displayed by the show running-configuration command cannot be used with the interface range command.
This example shows how to reenable all Fast Ethernet interfaces 5/1 to 5/5:
Switch(config)# interface range fastethernet 5/1 - 5
Switch(config-if-range)# no shutdown
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/1, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/2, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/3, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/4, changed state to up
*Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet5/5, changed state to up
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
*Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
This example shows how to use a comma to add different interface type strings to the range to reenable all Fast Ethernet interfaces in the range 5/1 to 5/5 and both Gigabit Ethernet interfaces 1/1 and 1/2:
Switch(config-if)# interface range fastethernet 5/1 - 5, gigabitethernet 1/1 - 2
Switch(config-if)# no shutdown
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/1, changed state to up
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/2, changed state to up
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/3, changed state to up
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/4, changed state to up
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet5/5, changed state to up
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet1/1, changed state to
*Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet1/2, changed state to
*Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
*Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
*Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet5/
If you enter multiple configuration commands while you are in interface-range configuration mode, each command is run as it is entered (they are not batched together and run after you exit interface-range configuration mode). If you exit interface-range configuration mode while the commands are being run, some commands might not be run on all interfaces in the range. Wait until the command prompt is displayed before exiting interface-range configuration mode.
Defining and Using Interface-Range Macros
You can define an interface-range macro to automatically select a range of interfaces for configuration. Before you can use the macro keyword in the interface-range macro command string, you must define the macro.
To define an interface-range macro, enter this command:
Command
|
Purpose
|
Switch(config)# define interface-range macro_name
{vlan vlan_ID - vlan_ID} | {{fastethernet |
gigabitethernet} slot/interface - interface}
[, {vlan vlan_ID - vlan_ID} {{fastethernet |
gigabitethernet} slot/interface - interface}]
|
Defines the interface-range macro and saves it in the running configuration file.
|
This example shows how to define an interface-range macro named enet_list to select Fast Ethernet interfaces 5/1 through 5/4:
Switch(config)# define interface-range enet_list fastethernet 5/1 - 4
To show the defined interface-range macro configuration, enter this command:
Command
|
Purpose
|
Switch# show running-config
|
Shows the defined interface-range macro configuration.
|
This example shows how to display the defined interface-range macro named enet_list:
Switch# show running-config | include define
define interface-range enet_list FastEthernet5/1 - 4
To use an interface-range macro in the interface range command, enter this command:
Command
|
Purpose
|
Switch(config)# interface range macro name
|
Selects the interface range to be configured using the values saved in a named interface-range macro.
|
This example shows how to change to the interface-range configuration mode using the interface-range macro enet_list:
Switch(config)# interface range macro enet_list
Configuring Optional Interface Features
The following sections describe optional procedures that you can perform on most interfaces:
•
Speed and Duplex Mode Configuration Guidelines
•
Setting the Interface Speed
•
Setting the Interface Duplex Mode
•
Displaying the Interface Speed and Duplex Mode Configuration
•
Adding a Description for an Interface
Speed and Duplex Mode Configuration Guidelines
You can configure the interface speed and duplex mode parameters to auto and allow the Catalyst 4000 family switch to negotiate the interface speed and duplex mode between interfaces. If you decide to configure the interface speed and duplex commands manually, consider the following:
•
If you set the interface speed to auto, the switch automatically sets the duplex mode to auto.
•
If you enter the no speed command, the switch automatically configures both interface speed and duplex to auto.
•
When you set the interface speed to 1000 Mbps, the duplex mode is full duplex. You cannot change the duplex mode.
•
If the interface speed is set to 10 or 100 mbps, the duplex mode is set to half duplex by default unless you explicitly configure it.
Caution 
Changing the interface speed and duplex mode configuration might shut down and restart the interface during the reconfiguration.
Setting the Interface Speed
If you set the interface speed to auto on a 10/100-Mbps Ethernet interface, speed and duplex are autonegotiated.
To set the port speed for a 10/100-Mbps Ethernet interface, perform this procedure:
| |
Task
|
Command
|
Step 1
|
Specify the interface to be configured.
|
Switch(config)# interface fastethernet slot/interface
|
Step 2
|
Set the interface speed of the interface.
|
Switch(config-if)# speed [10 | 100 | auto]
|
This example shows how to set the interface speed to 100 Mbps on the Fast Ethernet interface 5/4:
Switch(config)# interface fastethernet 5/4
Switch(config-if)# speed 100
Turning off autonegotiation on a Gigabit Ethernet interface will result in the port being forced into 1000 Mbps and full-duplex mode. To turn off the port speed autonegotiation for Gigabit Ethernet interface 1/1, perform this procedure:
| |
Task
|
Command
|
Step 1
|
Specify the interface to be configured.
|
Switch(config)# interface gigabitethernet1/1
|
Step 2
|
Disable autonegotiation on the interface.
|
Switch(config-if)# speed nonegotiate
|
To restore autonegotiation, enter the no speed nonegotiate command in the interface configuration mode.
Note
For the blocking ports on the WS-X4416 module, do not set the speed to autonegotiate.
Setting the Interface Duplex Mode
Note
When the interface is set to 1000 Mbps, you cannot change the duplex mode from full duplex to half duplex.
Note
If you set the port speed to auto on a 10/100-Mbps Ethernet interface, both speed and duplex mode are autonegotiated. The configured duplex mode is not applied on autonegotiation interfaces.
To set the duplex mode of a Fast Ethernet interface, perform this procedure:
| |
Task
|
Command
|
Step 1
|
Specify the interface to be configured.
|
Switch(config)# interface fastethernet
slot/interface
|
Step 2
|
Set the duplex mode of the interface.
|
Switch(config-if)# duplex [auto | full | half]
|
This example shows how to set the interface duplex mode to full on Fast Ethernet interface 5/4:
Switch(config)# interface fastethernet 5/4
Switch(config-if)# duplex full
Displaying the Interface Speed and Duplex Mode Configuration
To display the interface speed and duplex mode configuration for an interface, enter the following command:
Command
|
Purpose
|
Switch# show interfaces [fastethernet |
gigabitethernet] slot/interface
|
Displays the interface speed and duplex mode configuration.
|
This example shows how to display the interface speed and duplex mode of Fast Ethernet interface 6/1:
Switch# show interface fastethernet 6/1
FastEthernet6/1 is up, line protocol is up
Hardware is Fast Ethernet Port, address is 0050.547a.dee0 (bia 0050.547a.dee0)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:54, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 50/2000/0/0 (size/max/drops/flushes); Total output drops: 0
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
50 packets input, 11300 bytes, 0 no buffer
Received 50 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
1456 packets output, 111609 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
1 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Adding a Description for an Interface
You can add a description about an interface to help you remember its function. The description appears in the output of the following commands: show configuration, show running-config, and show interfaces.
To add a description for an interface, enter the following command:
Command
|
Purpose
|
Switch(config-if)# description string
|
Adds a description for an interface.
|
This example shows how to add a description on Fast Ethernet interface 5/5:
Switch(config)# interface fastethernet 5/5
Switch(config-if)# description Channel-group to "Marketing"
Understanding Online Insertion and Removal
The online insertion and removal (OIR) feature supported on the Catalyst 4000 family switches allows you to remove and replace modules while the system is online. You can shut down the module before removal and restart it after insertion without causing other software or interfaces to shut down.
You do not need to enter a command to notify the software that you are going to remove or install a module. The system notifies the supervisor engine that a module has been removed or installed and scans the system for a configuration change. The newly installed module is initialized, and each interface type is verified against the system configuration; then the system runs diagnostics on the new interface. There is no disruption to normal operation during module insertion or removal.
If you remove a module and then replace it, or insert a different module of the same type into the same slot, no change to the system configuration is needed. An interface of a type that has been configured previously will be brought online immediately. If you remove a module and insert a module of a different type, the interface(s) on that module will be administratively up with the default configuration for that module.
Monitoring and Maintaining the Interface
The following sections describe how to monitor and maintain the interfaces:
•
Monitoring Interface and Controller Status
•
Clearing and Resetting the Interface
•
Shutting Down and Restarting an Interface
Monitoring Interface and Controller Status
The Cisco IOS software for the Catalyst 4000 family switches contains commands that you can enter at the EXEC prompt to display information about the interface, including the version of the software and the hardware, the controller status, and statistics about the interfaces. The following table lists some of the interface monitoring commands. (You can display the full list of show commands by entering the show ? command at the EXEC prompt.) These commands are fully described in the Interface Command Reference.
To display information about the interface, perform this procedure:
| |
Task
|
Command
|
Step 1
|
Display the status and configuration of all interfaces or of a specific interface.
|
Switch# show interfaces [type slot/interface]
|
Step 2
|
Display the configuration currently running in RAM.
|
Switch# show running-config
|
Step 3
|
Display the global (system-wide) and interface-specific status of any configured protocol.
|
Switch# show protocols [type slot/interface]
|
Step 4
|
Display the hardware configuration, software version, the names and sources of configuration files, and the boot images.
|
|
This example shows how to display the status of Fast Ethernet interface 5/5:
Switch# show protocols fastethernet 5/5
FastEthernet5/5 is up, line protocol is up
Clearing and Resetting the Interface
To clear the interface counters shown with the show interfaces command, enter the following command:
Command
|
Purpose
|
Switch# clear counters {type slot/interface}
|
Clears interface counters.
|
This example shows how to clear and reset the counters on Fast Ethernet interface 5/5:
Switch# clear counters fastethernet 5/5
Clear "show interface" counters on this interface [confirm] y
*Sep 30 08:42:55: %CLEAR-5-COUNTERS: Clear counter on interface FastEthernet5/5
The clear counters command (without any arguments) clears all the current interface counters from all interfaces.
Note
The clear counters command does not clear counters retrieved with SNMP; it clears only those counters displayed with the EXEC show interfaces command.
Shutting Down and Restarting an Interface
You can disable an interface, which disables all functions on the specified interface and marks the interface as unavailable on all monitoring command displays. This information is communicated to other network servers through all dynamic routing protocols. The interface will not be mentioned in any routing updates.
To shut down an interface and then restart it, perform this procedure:
| |
Task
|
Command
|
Step 1
|
Specify the interface to be configured.
|
Switch(config)# interface {vlan vlan_ID} |
{{fastethernet | gigabitethernet} slot/port} |
{port-channel port_channel_number}
|
Step 2
|
Shut down the interface.
|
Switch(config-if)# shutdown
|
Step 3
|
Reenable the interface.
|
Switch(config-if)# no shutdown
|
This example shows how to shut down Fast Ethernet interface 5/5:
Switch(config)# interface fastethernet 5/5
Switch(config-if)# shutdown
*Sep 30 08:33:47: %LINK-5-CHANGED: Interface FastEthernet5/5, changed state to a
administratively down
This example shows how to reenable Fast Ethernet interface 5/5:
Switch(config-if)# no shutdown
*Sep 30 08:36:00: %LINK-3-UPDOWN: Interface FastEthernet5/5, changed state to up
To check whether an interface is disabled, enter the EXEC show interfaces command. An interface that has been shut down is shown as being administratively down when you enter the show interfaces command.