Configuring the Interfaces

This chapter provides the following major sections to describe how to configure and verify a router-to-modem interface.


Note For complete command syntax and usage, see Appendix A, “Command Reference.”


Using the Interface Command

The following 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:

Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
 

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 a fast Ethernet interface of 0:

Router(config)# interface fastEthernet 0/0
Router(config-if)#
 

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 fastEthernet0/0 or fastEthernet 0/0.


Step 3 Interface numbers are assigned at the factory at the time of installation. Enter the show interfaces EXEC command to see a list of all interfaces installed on your router. A report is provided for each interface that your router supports, as shown in this display:

Router(config-if)# Ctrl-Z
Router# show interfaces
FastEthernet0/0 is up, line protocol is up
Hardware is MV96340 Ethernet, address is 001f.ca0f.6508 (bia 001f.ca0f.6508)
Description: OPERATIONS ACCESS - DO NOT CHANGE ADDRESS
Internet address is 9.9.9.10/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 254/255, txload 1/255, rxload 6/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:06, output hang never
Last clearing of "show interface" counters never
Input queue: 18/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 2627000 bits/sec, 231 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
86251 packets input, 119155372 bytes
Received 5158 broadcasts (0 IP multicasts)
0 runts, 0 giants, 1 throttles
27 input errors, 0 CRC, 0 frame, 0 overrun, 27 ignored
0 watchdog
0 input packets with dribble condition detected
35714 packets output, 3513886 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Router#
 

Step 4 Follow each interface command with the interface-configuration commands your particular interface requires. The commands you enter define the protocols and applications that 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 5 You can use the exit command to exit interface configuration mode and return to global configuration mode.

Step 6 After you configure an interface, you can check the status of the interface by using the EXEC show commands listed in the “Monitoring and Maintaining Interfaces” section.


 

Configuring Interfaces

The following subsections describe interface configuration procedures:

Configuring an IP Address

To configure an IPv4 address and subnet mask on an interface, perform the following task:

 

Command
Purpose

Step 1

Router(config)# interface gigabitEthernet interface

Specifies the interface to be configured.

Step 2

Router(config-if)# ip address ip-addr mask

Sets the IP address.

Example

The following example shows how to set the IPv4 address 10.108.1.27 with subnet mask 255.255.255.0 on interface gigabitEthernet 0/0:

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 10.108.1.27 255.255.255.0

Adding a Description for an Interface

You can add a description about an interface to help you remember its function. The description displays 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 in interface configuration mode:

 

Command
Purpose
Router(config-if)# description string

Adds a description for an interface.

Examples

This example shows how to add the description Operations on gigabitEthernet interface 0/0 :

Router(config)# interface gigabitEthernet 0/0
Router(config-if)# description Operations
Router(config-if)# end
 

This example shows how to verify the configuration:

Router# show interface gigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Hardware is MV96340 Ethernet, address is 001f.ca0f.6508 (bia 001f.ca0f.6508)
Description: OPERATIONS ACCESS - DO NOT CHANGE ADDRESS
Internet address is 10.108.1.27/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 1000Mb/s, 1000BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:02, output 00:00:09, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/38054/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
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
3289500 packets input, 1652322462 bytes
Received 18932 broadcasts (0 IP multicasts)
0 runts, 0 giants, 37924 throttles
1933147 input errors, 0 CRC, 0 frame, 0 overrun, 1933147 ignored
0 watchdog
0 input packets with dribble condition detected
133400 packets output, 13054277 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Router#

Monitoring and Maintaining Interfaces

The following sections describe how to monitor and maintain the interfaces:

Monitoring Interface and Controller Status

The router contains commands that you can enter at the EXEC prompt to display information about the interface. 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, enter any of the following commands in user EXEC mode:

 

Command
Purpose
Router# show interfaces [ type interface ]

Displays the status and configuration of a specific interface or all interfaces.

Router# show running-config

Displays the configuration currently running in RAM.

Router# show protocols [ type interface ]

Displays the global (system-wide) and interface-specific status of any configured protocol.

Router# show version

Displays the hardware configuration, software version, names and sources of configuration files, and boot images.

This example shows how to display information about fastEthernet interface 0/0:

Router# show interfaces fastEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
Hardware is MV96340 Ethernet, address is 001f.ca0f.6508 (bia 001f.ca0f.6508)
Description: OPERATIONS ACCESS - DO NOT CHANGE ADDRESS
Internet address is 10.108.1.27/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 1000Mb/s, 1000BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:25, output 00:00:03, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/38054/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
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
3289517 packets input, 1652328854 bytes
Received 18949 broadcasts (0 IP multicasts)
0 runts, 0 giants, 37924 throttles
1933147 input errors, 0 CRC, 0 frame, 0 overrun, 1933147 ignored
0 watchdog
0 input packets with dribble condition detected
133525 packets output, 13066527 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Router#

Clearing and Resetting the Interface Counters

To clear the interface counters shown with the show interfaces command, enter the following command:

 

Command
Purpose
Router#clear counters { type interface }

Clears interface counters.

This example shows how to clear and reset the counters on Gigabit Ethernet interface 0/0:

Router#clear counters gigabitEthernet 0/0
Clear "show interface" counters on this interface [confirm] y
Router#
*Sep 30 08:42:55: %CLEAR-5-COUNTERS: Clear counter on interface gigabitEthernet0/0
by vty1 (171.69.115.10)
Router#
 

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.