Image of Jeremy L. Gaddis, CCNA, CCNP (and Cortney, in case you were wondering)

Configuring Interfaces on Cisco Devices

by Jeremy L. Gaddis on September 9, 2011 · 0 comments

Post image for Configuring Interfaces on Cisco Devices

Now that we’ve set passwords on the router and configured login banners, it’s time to connect our router to the network!

Routers are used to connect networks to each other. Chances are, you have a router at your home that connects your own network to your ISP’s network. Likewise, your ISP has routers that connects its network (and you) to other ISPs and/or the Internet backbone.

Nowadays, almost all local area networks (LANs), such as those in our homes and small businesses, are Ethernet-based. Most of the wide-are network (WAN) connections you will work with while preparing for the CCNA, however, will be using Serial interfaces. While there are many similarities between them, there are also many differences.

Getting Started

In order for an interface on a router to be able to forward IP traffic, it must have an IP address and subnet mask configured. In our home Cisco labs, we can use pretty much any IP addresses that we want. On real networks, however, we may have to obtain the correct IP addresses to use from others — certainly we do when it comes to connecting to our ISPs.

Configuring Interfaces on Cisco Routers

We’ll be using two routers for this exercise, R1 and R2. They are directly connected via their Ethernet 0/0 and Serial 1/0 interfaces.

NOTE: I’m using Cisco IOU for this article, instead of my home Cisco lab equipment. You may use whatever equipment or Cisco simulator you have available.

Configuring Ethernet Interfaces

First, we’ll configure the Ethernet 0/0 interfaces in order to establish a connection between the two routers. We will use the 192.168.12.0 subnet with a subnet mask of 255.255.255.0.

Configure R1’s Ethernet Connection

We’ll start our work on R1 which will use the IP address 192.168.12.1. If your router has an existing configuration on it, follow the directions in Erasing and Saving Configurations on Cisco Devices to erase the configuration and start with a clean slate.

The first task is to set the hostname, which we learned how to do in Assigning Hostnames to Cisco Devices. Set the hostname to R1:

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

ON YOUR OWN: While you’re here, go ahead and set passwords on the router (it’s good practice). Refer back to Setting Passwords on Cisco Devices if you need a reminder.

Next, move into interface configuration mode for the Ethernet 0/0 interface. Let’s assign a description to this interface so that we know what it’s used for:

R1(config)# interface ethernet 0/0
R1(config-if)# description Connection to R2 E0/0
R1(config-if)#

Note that the interface description is completely optional. It does not serve any real purpose in IOS. We will use interface descriptions to remind us what each interface connects to, however. You can put anything in the description that you wish — or nothing at all. The description will be shown in the output of these commands:

  • show interfaces
  • show running-config
  • show startup-config

NOTE: In “the real world”, we often put the circuit IDs (assigned by our ISPs) into the description field so that they’re readily available whenever problems arise.

Assign the IP address and subnet mask mentioned above to the interface:

R1(config-if)# ip address 192.168.12.1 255.255.255.0

Our last step is to enable the interface or “bring it up”. By default, the shutdown command is present in the configuration, which disables the interface. To enable it, we need to remove this by executing the no shutdown command.

R1(config-if)# no shutdown

A few seconds after executing the no shutdown command, you should see output on your screen similar to the following:

*Sep  9 03:48:05.499: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Sep  9 03:48:06.504: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up

At this point, the Ethernet 0/0 interface should be functional. We can verify this by using one of the Basic Cisco IOS Router & Switch Commands we learned earlier, show ip interface brief.

R1(config-if)# end
R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.1    YES manual up                    up
Ethernet0/1                unassigned      YES unset  administratively down down
Ethernet0/2                unassigned      YES unset  administratively down down
Ethernet0/3                unassigned      YES unset  administratively down down
Serial1/0                  unassigned      YES unset  administratively down down
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

As you can see, there are a lot more interfaces in this router (eight altogether) but we’re only concerned with Ethernet 0/0 for the moment. As long as the “Status” and “Protocol” columns are both “up”, we’re in good shape.

NOTE: You’ll often hear this referred to as “up/up”.

At this point, our work on R1 is done and we can move over to R2.

Configure R2’s Ethernet Connection

We’ll configure R2 in exactly the same manner as R1. The only difference will be the IP address and interface description. Here’s the configuration for R2, minus the commentary:

Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface ethernet 0/0
R2(config-if)# description Connection to R1 E0/0
R2(config-if)# ip address 192.168.12.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# end

ON YOUR OWN: Go ahead and configure the enable secret and line VTY password on R2 as well, just as you did on R1.

Once again, you should see the “%LINK-3-UPDOWN” and “%LINEPROTO-5-UPDOWN” messages on the console and, as above, show ip interface brief should show that Ethernet 0/0 is “up/up”:

R2# show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.2    YES manual up                    up
Ethernet0/1                unassigned      YES unset  administratively down down
Ethernet0/2                unassigned      YES unset  administratively down down
Ethernet0/3                unassigned      YES unset  administratively down down
Serial1/0                  unassigned      YES unset  administratively down down
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

Verifying the Ethernet Connection

Once the Ethernet 0/0 interface is functional on both routers, we need some way of verifying that there is connectivity.

Normally, we’d use an extremely basic but immensely useful troubleshooting tool called “ping” but we haven’t yet talked about it. Instead, let’s use another tool that’s available to us and that we have talked about (if only briefly): telnet.

We should be able to telnet to each of the routers from the other one. Pick one of the two routers (it doesn’t matter which one) and telnet to the IP address of the other router:

R1# telnet 192.168.12.2
Trying 192.168.12.2 ... Open

User Access Verification

Password:
R2>

Hopefully, you will see similar results. Being able to establish a telnet connection from one router to the other verifies that our interfaces are working.

Configuring Serial Interfaces

The serial connection is configured in exactly the same manner. Normally, our serial interface will be used to connect to an ISP. In our lab exercises (or any other time you have two serial interfaces connected “back-to-back” such as in this exercise), though, there’s one extra step that we’ll need to take.

Serial interfaces require a clock signal in order to control the timing of frames that are sent out. When connected to an ISP, a (“DCE”) device such as a CSU/DSU normally provides the clocking signal for our Cisco routers (which are “DTE” devices). On these “back-to-back” connections, we must configure one of the two routers as a DCE device in order to provide that clocking signal.

Configure R1’s Serial Connection

Let’s go ahead and configure R1 just as we did for the Ethernet connection. Use the following values for the Serial 1/0 interface:

  • IP address: 172.16.12.1
  • Subnet mask: 255.255.255.252
  • Description: Connection to R2 S1/0

After issuing the no shutdown command, you should see output similar to the following:

*Sep  9 04:57:54.584: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Sep  9 04:57:55.590: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

Another 20-30 seconds later, you should see another message:

*Sep  9 04:58:17.107: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to down

Let’s look at the output from show ip interface brief:

R1(config-if)# end
R1# show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.1    YES manual up                    up
Ethernet0/1                unassigned      YES unset  administratively down down
Ethernet0/2                unassigned      YES unset  administratively down down
Ethernet0/3                unassigned      YES unset  administratively down down
Serial1/0                  172.16.12.1     YES manual up                    down
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

As you can see, the Serial 1/0 interface is in the “up/down” state. The line protocol being down is quite often caused by a clocking or framing problem or encapsulation mismatch (which we’ll talk about later).

Right now, though, it’s because we haven’t configured R2’s side of the connection yet!. Let’s do that now.

Configure R2’s Serial Connection

Go ahead and configure R2 in the same way you did R1, using 172.16.12.2 as the IP address. We’re going to issue one more command in interface configuration mode, however:

R2(config-if)# clock rate 128000

This command instructs R2 to provide the clocking signal that is needed in order for successful communications to take place. (You may be able to adjust the value up or down, depending on the physical serial interfaces present in your routers.)

After issuing the no shutdown command on R2, we’ll see output similar to what we saw on R1:

*Sep  9 05:06:02.103: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Sep  9 05:06:03.109: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

If you happen to look at the console of R1, you should also notice that the line protocol has changed to “up”:

*Sep  9 05:06:17.338: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

Verifying the Serial Connection

Once you’ve configured the serial interfaces on both routers, take another look at the output from the show ip interfaces brief command. You should see that both Serial 1/0 interfaces are in the “up/up” state.

Once again, we can use the telnet command to verify that we are able to successfully communicate:

R2# telnet 172.16.12.1
Trying 172.16.12.1 ... Open

User Access Verification

Password:
R1>

If you are able to connect, you have successfully configured the serial connection!

Lab Exercise

Summary

As you can see, configuring basic Ethernet and Serial connections between devices isn’t that difficult. Later, though, we’ll introduce some much harder scenarios.

The ability to successfully configure router interfaces is absolutely critical — we won’t be able to route traffic across the network if we can’t bring an interface up!

Sometimes, things seem like they should be working but really aren’t. In the next article, you’ll learn how to use ping for troubleshooting and verification.

Image Source

Previous post:

Next post: