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
Router3(config-if)#
Serial1
description
Router3(config-if)#
WAN Connection to Chicago
ip address
Router3(config-if)#
192.168.99.5 255.255.255.252
encapsulation
Router3(config-if)#
hdlc
clock rate
Router3(config-if)#
56000
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
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#
Serial1
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.