Configuring Serial Interfaces

Problem

You want to configure a serial interface for a WAN connection.

Solution

When you configure a router’s serial interface, you need to specify the encapsulation, the IP address, and whether the interface will be the DCE or DTE:

Router3#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router3(config)#interface Serial1
Router3(config-if)#description WAN Connection to Chicago
Router3(config-if)#ip address 192.168.99.5 255.255.255.252
Router3(config-if)#encapsulation hdlc
Router3(config-if)#clock rate 56000
Router3(config-if)#no shutdown 
Router3(config-if)#exit
Router3(config)#end
Router3#

Discussion

There are a couple of extremely important commands in this sample configuration. The first sets the serial encapsulation protocol. In this case, we have used the High-Level Data Link Control (HDLC) protocol, which is a standard Layer 2 protocol for synchronous serial connections:

Router3(config-if)#encapsulation hdlc

In fact, HDLC is the default encapsulation type for synchronous serial interfaces on Cisco routers, so we could have omitted this command. Because it is the default, this command does not show up in the configuration when we show the configuration:

Router3#show running-config interface Serial1 
Building configuration...

Current configuration : 123 bytes
!
interface Serial1
 description WAN Connection to Chicago
 ip address 192.168.99.5 255.255.255.252
 clock rate 56000
end

Router3#

If you prefer to use a different encapsulation ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.