Configuring a Cisco Router

Configuring a Cisco Router

When the hardware installation is complete and the Cisco router has the initial configuration, you can begin configuring the router for a specific internetwork. You must be familiar with the Cisco IOS command-line interface (CLI), its modes, and its operation before configuring more advanced features such as IP routing. The following sections describe how to implement a basic configuration for a Cisco router.

Cisco Router Configuration Modes

From privileged EXEC mode, you can enter global configuration mode, providing access to the specific router configuration modes. Figure 4-26 illustrates the different configuration modes and shows how to navigate them.

Figure 4-26 Navigating Configuration Modes

Configuring a Cisco Routerfig4.26

The first step in configuring a Cisco router is to use the setup utility. Setup allows you to create a basic initial configuration. For more complex and specific configurations, you can use the CLI to enter terminal configuration mode.

From the privileged EXEC mode, you can enter the global configuration mode with the configure terminal command. From the global configuration mode, you can access the specific configuration modes, which include the following:

  • Interface: Supports commands that configure operations on a per-interface basis
  • Subinterface: Supports commands that configure multiple virtual interfaces on a single physical interface
  • Controller: Supports commands that configure controllers (for example, E1 and T1 controllers)
  • Line: Supports commands that configure the operation of a terminal line; for example, the console or the vty ports
  • Router: Supports commands that configure an IP routing protocol

If you enter the exit command, the router will back out one level, eventually logging out. In general, you can enter the exit command from one of the specific configuration modes to return to global configuration mode. Press Ctrl-Z to leave the configuration mode completely and return the router to the privileged EXEC mode. In terminal configuration mode, an incremental compiler is invoked. Each configuration command entered is parsed as soon as the Enter key is pressed.

If there are no syntax errors, the command is executed and stored in the running configuration, and it is effective immediately.
Commands that affect the entire router are called global commands. The hostname and enable password commands are examples of global commands.

Commands that point to or indicate a process or interface that will be configured are called major commands. When entered, major commands cause the CLI to enter a specific configuration mode. Major commands have no effect unless a subcommand that supplies the configuration entry is immediately entered. For example, the major command interface serial 0 has no effect unless it is followed by a subcommand that tells what is to be done to that interface.
The following are examples of some major commands and subcommands that go with them:

Notice that entering a major command switches from one configuration mode to another. It is not necessary to return to the global configuration mode first before entering another configuration mode.

After you enter the commands to configure the router, you must save the running configuration to NVRAM with the copy running-config startup-config command. If the configuration is not saved to NVRAM and the router is reloaded, the configuration will be lost and the router will revert to the last configuration saved in NVRAM. Example 4-10 shows saving the configuration file to startup.

Example 4-10 Saving Configuration File

Example 4-10 Saving Configuration File

Configuring a Cisco Router from the CLI

The configuration mode of the CLI is used to configure the router name, password, and other console commands.

One of the first tasks in configuring a router is to name it. Naming the router helps you to better manage the network by enabling you to uniquely identify each router within the network. The name of the router is considered to be the host name and is the name displayed at the system prompt. If no name is configured, the default router name is Router. The router name is assigned in global configuration mode. In Example 4-11, the router name is set to RouterA.

Example 4-11 Assigning the Router Name

You can configure a message-of-the-day (MOTD) banner to be displayed on all connected terminals. This banner is displayed at login and is useful for conveying messages, such as impending system shutdowns that might affect network users. When you enter the banner motd command, follow the command with one or more blank spaces and a delimiting character of any choice. In the example, the delimiting character is a pound sign (#). After entering the banner text, terminate the message with the same delimiting character.

You can also add a description to an interface to help remember specific information about that interface, such as the network serviced by that interface. This description is meant solely as a comment to help identify how the interface is being used. The description will appear in the output when the configuration information that exists in router memory is displayed, as well as in a show interfaces command display.

Other useful console-line commands include the exec-timeout command. In the following example, the exec-timeout command sets the timeout for the console EXEC session to 20 minutes and 30 seconds, which changes the session from the default timeout of 10 minutes. The logging synchronous console-line command is useful when console messages are being displayed while you are attempting to input EXEC or configuration commands. Instead of the console messages being interspersed with the input, the input is redisplayed on a single line at the end of each console message that “interrupts” the input. This makes reading the input and the messages much easier. Example 4-12 shows how to configure these console settings.

Example 4-12 Configuring Console Settings

CAUTION Setting the exec-timeout settings too high can be a security risk.

Configuring Cisco Router Interfaces

The main function of a router is to forward packets from one network device to another. To do that, you must define the characteristics of the interfaces through which the packets are received and sent.

The router interface characteristics include, but are not limited to, the IP address of the interface, the data-link encapsulation method, media type, bandwidth, and clock rate. You can enable many features on a per-interface basis. Interface configuration-mode commands modify the operation of Ethernet, serial, and many other interface types. When you enter the interface command, you must define the interface type and number. The number is assigned to each interface based on the physical location of the interface hardware in the router and is used to identify each interface.

This identification is critical when there are multiple interfaces of the same type in a single router. Examples of an interface type and number are as follows:

An interface in a Cisco 2800 and 3800 Series Integrated Services Router, or other modular router, is specified by the physical slot in the router and port number on the module in that slot, as follows:
Router(config)# interface fa 1 /0
To quit the interface configuration mode, enter the exit command at the Router (config-if) # prompt.
To add a description to an interface configuration, use the description command in interface configuration mode. To remove the description, use the no description command.
The description will show up when using the show interface command.

You might want to disable an interface to perform hardware maintenance on a specific interface or segment of a network. You might also want to disable an interface if a problem exists on a specific segment of the network and you must isolate that segment from the rest of the network.

The shutdown subcommand administratively turns off an interface. To reinstate the interface, use the no shutdown subcommand. Example 4-13 shows the commands and output for these commands.

Example 4-13 Disabling and Enabling Serial Interfaces

When an interface is first configured, unless in setup mode, you must administratively enable the interface before it can be used to transmit and receive packets. Use the no shutdown subcommand to allow the Cisco IOS Software to use the interface.

Configuring the Cisco Router IP Address

Each interface on a Cisco router must have its own IP address to uniquely identify it on the network. Figure 4-27 illustrates unique IP addresses for each network attached to the router.

Figure 4-27 Interface Addresses

Configuring a Cisco Routerfig4.27

To configure an interface on a Cisco router, follow these steps:
Step 1 Enter global configuration mode using the configure terminal command:

Step 2 Identify the specific interface that requires an IP address by using the interface type slot/port command:

Step 3 Set the IP address and subnet mask for the interface by using the ip address ip-address mask command:

Step 4 Enable the interface to change the state from administratively down to up by using the no shutdown command:

Step 5 Exit configuration mode for the interface by using the exit command:

Verifying the Interface Configuration

When you have completed the router interface configuration, you can verify the configuration by using the show interfaces command.

The show interfaces command displays the status and statistics of all network interfaces on the router. Alternatively, the status for a specific interface can be displayed by using the show interfaces type slot command. Example 4-14 shows common output for the show interfaces command.

Example 4-14 show interfaces Command Output

Output fields for an Ethernet interface and their meanings are shown in Table 4-6.
Table 4-6 show interfaces Output Field Descriptions
Configuring a Cisco Routertb4.6
Configuring a Cisco Routertb4.6-1

One of the most important elements of the show interfaces command output is the display of the line and data-link protocol status. For other types of interfaces, the meanings of the status line can be slightly different. Figure 4-28 highlights the key output for this command.

Figure 4-28 Interface State
Configuring a Cisco Routerfig4.28

The first parameter refers to the hardware layer and essentially reflects whether the interface is receiving the carrier detect signal from the other end (the data communications equipment [DCE]). The second parameter refers to the data link layer and reflects whether the data link layer protocol keepalives are being received.
Based on the output of the show interfaces command, possible problems can be fixed as follows:

  • If the interface is up and the line protocol is down, a problem exists. Some possible causes include the following:
    • No keepalives
    • Mismatch in encapsulation type
  • If both the line protocol and the interface are down, a cable might never have been attached when the router was powered up, or some other interface problem must exist.
    For example, in a back-to-back connection, the other end of the connection might be administratively down.
  • If the interface is administratively down, it has been manually disabled (the shutdown command has been issued) in the active configuration.

After configuring a serial interface, use the show interface serial command to verify the changes.

About the author


Leave a Comment