第 13章 异步接口配置
13.1 异步接口配置
13.1.1 物理层配置
1,Modem配置
Branch(config)#line 33
Branch(config-line)#modem autoconfigure type
hayes_optima
图 13-1-1 命令 show modemcap的输出
B r a n c h # s h o w m o d e m c a p
d e f a u l t
c o d e x _ 3 2 6 0
u s r _ c o u r i e r
u s r _ s p o r t s t e r
h a y e s _ o p t i m a
g l o b a l _ v i l l a g e
v i v a
t e l e b i t _ t 3 0 0 0
m i c r o c o m _ h d m s
m i c r o c o m _ s e r v e r
n e c _ v 3 4
n e c _ v 1 1 0
n e c _ p i a f s
c i s c o _ v 1 1 0
m i c r o c o m _ m i m i c
m i c a
n e x t p o r t
Branch(config)#line 33
Branch(config-line)#modem autoconfigure discovery
图 13-1-2 路由器自动发现调制解调器类型
* M a r 1 0 0,0 0,4 3,7 6 7,T T Y 1 0 4,d e t e c t i o n s p e e d ( 1 1 5 2 0 0 ) r e s p o n s e - - - O K - - -
* M a r 1 0 0,0 0,4 3,7 6 7,T T Y 1 0 4,M o d e m t y p e i s m i c r o c o m _ m i m i c
* M a r 1 0 0,0 0,4 3,7 7 1,T T Y 1 0 4,M o d e m c o m m a n d,- - A T & F —
* M a r 1 0 0,0 0,4 6,3 4 3,T T Y 1 0 4,M o d e m c o n f i g u r a t i o n s u c c e e d e d
* M a r 1 0 0,0 0,4 6,3 4 3,T T Y 1 0 4,D e t e c t e d m o d e m s p e e d 9 6 0 0
* M a r 1 0 0,0 0,4 6,3 4 3,T T Y 1 0 4,D o n e w i t h m o d e m c o n f i g u r a t i o n
show line
图 13-1-3 路由器自动发现的调制解调器类型
C e n t e r # s h o w l i n e 9 7
T t y T y p T x / R x A M o d e m R o t y A c c O A c c I U s e s N o i s e O v e r r u n s I n t
9 7 T T Y - i n o u t - - - 0 0 0 / 0 -
L i n e 9 7,L o c a t i o n," ",T y p e," "
L e n g t h,2 4 l i n e s,W i d t h,8 0 c o l u m n s
S t a t u s,N o E x i t B a n n e r,M o d e m D e t e c t e d,C T S R a i s e d
C a p a b i l i t i e s,M o d e m C a l l o u t,M o d e m R I i s C D,
L i n e i s p e r m a n e n t a s y n c i n t e r f a c e,M o d e m A u t o c o n f i g u r e,I n t e g r a t e d M o d e m
M o d e m s t a t e,I d l e
m o d e m ( s l o t / p o r t ),3 / 0,c s m _ s t a t e,I D L E _ S T A T E,
b c h a n _ n u m,- 1 c s m _ s t a t u s ( 0 ),C S M _ S T A T U S _ U N L O C K E D
M o d e m h a r d w a r e s t a t e,C T S n o D S R D T R R T S,M o d e m C o n f i g u r e d
… … … …
M o d e m t y p e i s m i c r o c o m _ m i m i c,
… … … …
2.设置接口速率
Center(config-line)#speed 115200
3.设置流量控制方法
Center(config-line)#flowcontrol hardware
4.设置停止位位数
Center(config-line)#stopbits 1
5.设置允许的数据流向
Center(config-line)#modem inout
6.定义线路允许的协议
Center(config-line)#transport input all
13.1.2 接口网络层配置
1.配置接口通信模式
Branch(config)#interface serial 0/1
Branch(config-if)#physical-layer async
2.配置接口封装格式
Branch(config-if)#encapsulation ppp
3.接口异步模式
async mode dedicated | interactive
4.分配接口 IP地址
Branch(config-if)#ip address 192.168.0.1
255.255.255.0

Branch(config)#interface loopback 0
Branch(config-if)#ip address 10.0.0.1 255.255.255.0
Branch(config-if)#interface serial 1/1
Branch(config-if)#ip unnumbered loopback 0
5.分配客户端 IP地址下面的命令为客户端指定了 IP地址 192.168.0.2
Branch(config-if)#peer default ip address 192.168.0.2
下面的命令指定了由网络中的 DHCP服务器为客户端分配
IP地址。
Branch(config-if)#peer default ip address dhcp
下面的命令指定从本地 IP地址池 ip-pool中分配一个 IP地址给客户端。
Branch(config-if)#peer default ip address pool ip-pool
建立一个名为 rasclients的 IP地址池
Branch(config)#ip local pool rasclients 192.168.1.1
192.168.1.254
13.2 路由器异步远程维护
13.2.1 路由器端的准备工作图 13-2-1 利用异步串行接口对路由器进行远程维护
13.2.2 客户端的准备工作右击新建的连接,选择,属性,,弹出,拨号属性,对话框。
单击以选择,安全措施选项卡。在此对话框中选中,显示终端窗口,单选按钮并单击确定按钮退出,拨号属性,对话框。
13.3 配置路由器作为远程访问服务器
13.3.1 路由器端的准备工作图 13-3-1 配置路由器作为远程访问服务器
S 1 / 0,unnumbered loopback 0
Loopback 0,10,0,0,1
RAS
Usernam e abc passw ord 123
Int l oop back 0
Ip address 10,0,0,1 255,255,255,0
int erf ace Seri al 1 / 0
physi cal - la yer a sync
i p unnu m bered Loo pback 0
e ncapsulat ion ppp
a sync m ode dedica te d
pee r defa ult i p address 10,0,0,2
li ne 33
l ogin l ocal
M odem autoconf ty pe def ault
m odem InO ut
t ransport i npu t al l
s topbit s 1
s peed 115200
f low control har dw are
13.3.2 客户端的准备工作
13.4 配置路由器间的异步拨号链路图 13-4-1 路由器间的异步拨号链路分 支 机 构中 心
S 1 / 0,1 9 2,1 6 8,0,2 / 2 4
S 1 / 0,1 9 2,1 6 8,0,1 / 2 4
B R A N C H
C E N T E R
T e l,2 0 8 3 7 0 3
T e l,2 0 8 3 1 5 0
13.4.1 路由器配置图 13-4-2 路由器间的异步拨号链路配置
13.4.2 测试、诊断
1.查看接口状态图 13-4-3 命令 show interface serial 1/0的输出
B r a n c h # s h o w i n t e r f a c e s s e r i a l 1 / 0
S e r i a l 1 / 0 i s u p ( s p o o f i n g ),l i n e p r o t o c o l i s u p ( s p o o f i n g )
H a r d w a r e i s C D 2 4 3 0 i n a s y n c m o d e
I n t e r n e t a d d r e s s i s 1 9 2,1 6 8,0,2 / 2 4
M T U 1 5 0 0 b y t e s,B W 1 1 5 K b i t,D L Y 1 0 0 0 0 0 u s e c,
r e l i a b i l i t y 2 5 5 / 2 5 5,t x l o a d 1 / 2 5 5,r x l o a d 1 / 2 5 5
E n c a p s u l a t i o n P P P,l o o p b a c k n o t s e t
K e e p a l i v e n o t s e t
D T R i s p u l s e d f o r 5 s e c o n d s o n r e s e t
L C P C l o s e d
C l o s e d,I P C P
L a s t i n p u t 0 0,5 2,3 4,o u t p u t 0 0,5 2,3 4,o u t p u t h a n g n e v e r
L a s t c l e a r i n g o f " s h o w i n t e r f a c e " c o u n t e r s 0 0,5 2,4 3
I n p u t q u e u e,0 / 7 5 / 0 / 0 ( s i z e / m a x / d r o p s / f l u s h e s ) ; T o t a l o u t p u t d r o p s,0
Q u e u e i n g s t r a t e g y,w e i g h t e d f a i r
1,
2,
3,
4,
5,
6,
7,
8,
9,
1 0,
1 1,
1 2,
1 3,
1 4,
1 5,
2.查看线路状态图 13-4-4 命令 show line的输出
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
3.激发测试流量图 13-4-5 debug modem的输出图 13-4-6 线路被激活的控制台消息
00,27,44,CHAT 33,A tte m p tin g a s y n c lin e d ia le r s cr ip t
00,27,44,CHAT 33,p ro ce s s s ta rte d
00,27,44,CHAT 33,A s s er tin g D T R,....
00,28,04,TTY 33,n o t im er t y p e 1 to d es tro y
00,28,04,TTY 33,n o t im er t y p e 0 to d es tro y
00,28,04,TTY 33,n o t im er t y p e 2 to d es tro y
00,28,47,TTY 0,tim er t y p e 1 ex p ire d
00,28,47,TTY 0,E x ec t im er ( co n tin u ed )
00,28,06,% L IN K - 3 - U P D O W N,In terfa ce S eria l 1 / 0,changed st at e t o up
00,28,07,% L IN E P R O T O - 5 - U P D O W N,L ine p ro toc ol on In terfa ce S eria l 1 / 0,changed st a
te to u p
图 13-4-7 debug dialer的输出
00,36,51,Se 1 / 0 DDR,D iali ng cau se ip ( s = 192,168,0,2,d = 192,168,0,1 )
00,36,51,Se 1 / 0 DDR,A ttemptin g to dial 15
00,36,51,CHAT 33,A ttemptin g asy nc line dialer scrip t
00,36,51,CHAT 33,D iali ng u sing M od em scrip t,dialo ut & S ys tem s cript,none
00,36,51,CHAT 33,pr oc ess started
00,36,51,CHAT 33,A sserting D T R
00,36,51,CHAT 33,C ha t scrip t d ialou t started,....
00,37,11,CHAT 33,C ha t scrip t d ialou t finish ed,status = S uc cess !!!
00,37,13,Se 1 / 0 DDR,D ialer statecha ng e to u p
00,37,13,Se 1 / 0 DDR,D ialer call h as b een p laced
00,37,13,Se 1 / 0 DDR,dialer pr oto co l u p
00,37,13,Se 1 / 0 DDR,C all con ne cted,8 pa ck ets u nq ue ue d,8 trans mitted,0 disca r
de d
4,show interface
图 13-4-8 命令 show interface serial 1/0的输出
10.
Branch#show interfaces serial 1/0
Serial1/0 is up,line protocol is up
Hardware is CD2430 in async m ode
Internet address is 192.168.0.2/24
M TU 1500 bytes,BW 115 Kbit,DLY 100000 usec,
reliability 255/255,txload 1/255,rxload 1/255
Encapsulation PPP,loopback not set
Keepalive not set
DTR is pulsed for 5 seconds on reset
Tim e to interface disconnect,idle 00:00:18
1.
2.
3.
4.
5.
6.
7.
8.
9.
5,show ip interface
图 13-4-9 命令 show ip interface serial 1/0的输出
7.
Branch#show ip interface serial 1/0
Serial1/0 is up,line protocol is up
Internet address is 192.168.0.2/24
Broadcast address is 255.255.255.255
Address determ ined by setup com m and
Peer address is 192.168.0.1
M TU is 1500 bytes
… …
1.
2.
3.
4.
5.
6.
8.
6,show line
图 13-4-10 命令 show
line 33的输出
Bra nch # show l in e 33
Tty Typ Tx / Rx A Modem Roty Acc O AccI Uses Noise Over ru ns I nt
A 33 TTY 115200 / 115200 - in out - - - 2 0 0 / 0 Se 1 / 0
Ready
Line 33,Locat io n," PPP,192,168,0,1 ",Type," "
Lengt h,24 li nes,Wi dt h,80 col um ns
Baud r at e ( TX / RX ) is 115200 / 115200,no pa ri ty,1 sto pbi ts,8 dat abi ts
Sta tu s,Ready,Act iv e,Async In te rf ace Acti ve,HW PPP Supp or t Act iv e
Mode m Dete ct ed,CTS Raise d
Capab il it ie s,Har dwar e Fl owcon tr ol In,Har dwar e Fl owcon tr ol Out
Mode m Call out,Mod em RI i s CD,Line is pe rm ane nt asyn c i nt er fa ce
Mode m Auto con fi gur e
Mod em sta te,Ready
Gro up co des,0
Line is r unni ng PPP fo r a ddr ess 192,168,0,1,
… …
Mod em typ e i s def aul t,
Sess io n li m it is no t se t,
Tim e si nce act iv at io n,never
Edit in g is ena bl ed,
Hist or y is ena bl ed,hi sto ry siz e i s 10,
DNS re sol ut io n in show co m m and s is ena bl ed
Ful l us er hel p is dis abl ed
All owed i nput tr ansp or ts a re la t pa d v 120 m op t el net rl ogi n udp tn nasi,
All owed o ut put tr ansp or ts a re la t pa d v 120 m op t el net rl ogi n nas i,
… …
7,debug dialer packets
00,46,14,Se 1 / 0 DDR,ip ( s = 192,168,0,2,d = 192,168,0,1 ),100 by tes,ou tgo ing in te
res ting ( ip P E R M IT )
00,46,14,DDR,P ac ke t q ue ue d,
00,46,16,Se 1 / 0 DDR,ip ( s = 192,168,0,2,d = 192,168,0,1 ),100 by tes,ou tgo ing in te
res ting ( ip P E R M IT )
00,46,16,DDR,P ac ke t q ue ue d,
00,46,18,Se 1 / 0 DDR,ip ( s = 192,168,0,2,d = 192,168,0,1 ),100 by tes,ou tgo ing in te
res ting ( ip P E R M IT )
00,46,18,DDR,P ac ke t q ue ue d,
00,46,20,Se 1 / 0 DDR,ip ( s = 192,168,0,2,d = 192,168,0,1 ),100 by tes,ou tgo ing in te
res ting ( ip P E R M IT )
00,46,20,DDR,P ac ke t q ue ue d,
8,debug chat
图 13-4-12 命令 debug chat的输出
00,50,33,CHAT 33,A ttemptin g asy nc line dialer scrip t
00,50,33,CHAT 33,D iali ng u sing M od em scrip t,dialo ut & S ys tem s cript,none
00,50,33,CHAT 33,pr oc ess started
00,50,33,CHAT 33,A sserting D TR
00,50,33,CHAT 33,C ha t scrip t d ialou t started
00,50,33,CHAT 33,S en din g string,A T Z
00,50,33,CHAT 33,Ex pe cting strin g,OK
00,50,33,CHAT 33,C om pleted m atch fo r ex pe ct,OK
00,50,33,CHAT 33,S en din g string,A TD T \ T < 15 >
00,50,33,CHAT 33,Ex pe cting strin g,C O N N EC T,....
00,52,09,CHAT 33,C om pleted m atch fo r ex pe ct,C O N N EC T
00,52,09,CHAT 33,S en din g string,\ c
00,52,09,CHAT 33,C ha t scrip t d ialou t finish ed,status = S uc cess
9.测试连通性
10,show dialer
图 13-4-14 命令 show dialer的输出
B r a n c h # s h o w d i a l e r
S e 1 / 0 - d i a l e r t y p e = I N - B A N D A S Y N C N O - P A R I T Y
I d l e t i m e r ( 3 0 0 s e c s ),F a s t i d l e t i m e r ( 2 0 s e c s )
W a i t f o r c a r r i e r ( 6 0 s e c s ),R e - e n a b l e ( 1 5 s e c s )
D i a l e r s t a t e i s d a t a l i n k l a y e r u p
D i a l r e a s o n,i p ( s = 1 9 2,1 6 8,0,2,d = 1 9 2,1 6 8,0,1 )
T i m e u n t i l d i s c o n n e c t 5 s e c s
C o n n e c t e d t o 2 0 8 3 7 0 3
D i a l S t r i n g S u c c e s s e s F a i l u r e s L a s t D N I S L a s t s t a t u s
2 0 8 3 7 0 3 3 0 0 0,0 1,1 7 s u c c e s s f u l
1,
2,
3,
4,
5,
6,
7,
8,
9,
1 0,
1 1,
1 2,
11.超时测试图 13-4-15 命令 debug modem的输出
00,33,54,TTY 33,A sync Int reset,D ropping D TR ^ Z
00,33,55,TTY 33,D S R w as d ropped
00,33,55,tty 33,Mod em,R EA D Y - > ( unkn ow n )
00,33,56,% LIN K - 5 - C H A N G ED,Inter face S erial 1 / 0,changed state t o reset
00,33,56,TTY 33,dropping D TR,hang ing u p
00,33,56,tty 33,Mod em,HANGUP - > ( unkn ow n )
00,33,57,% LIN EP R O TO - 5 - U P D O WN,Line protocol on Inter face S erial 1 / 0,changed sta
te to do w n
00,33,57,TTY 33,cleanup pend ing,D elaying D TR
00,33,58,TTY 33,cleanup pend ing,D elaying D TR
00,33,59,TTY 33,no timer type 0 to des troy
00,33,59,TTY 33,no timer type 1 to des troy
00,33,59,TTY 33,no timer type 3 to des troy
00,33,59,TTY 33,no timer type 4 to des troy
00,33,59,TTY 33,no timer type 10 to des troy
00,33,59,TTY 33,no timer type 2 to des troy
00,33,59,S erial 1 / 0,allow ing mod em _ process to con tinue han gup
00,34,00,TTY 33,restori ng D TR
00,34,00,TTY 33,autocon figure probe s tart ed
00,34,01,% LIN K - 3 - U P D O WN,Inter face S erial 1 / 0,changed state t o dow n
图 13-4-16 命令 debug dialer的输出图 13-4-17 线路断开的控制台消息
00,38,12,Se 1 / 0 DDR,idl e t im eout
00,38,12,Se 1 / 0 DDR,disc onnecti ng call
00,38,29,Se 1 / 0 DDR,re - enable ti meout
00,40,00,% L IN K - 5 - CHANGED,In terfa ce S eria l 1 / 0,changed st at e t o res et
00,40,01,% L IN E P R O T O - 5 - U P D O W N,L ine p ro toc ol on In terfa ce S eria l 1 / 0,changed st a
te to d ow n
00,40,05,% L IN K - 3 - U P D O W N,In terfa ce S eria l 1 / 0,changed st at e t o dow n
13.5 实验 1 利用异步串行接口对路由器进行远程维护一、实验目的掌握利用异步串行接口对路由器进行远程维护的基本配置步骤和方法。
二、实验任务配置路由器的异步串行接口实现对路由器的远程维护。
三、实验设备路由器 Cisco 2611一台,带有网卡的工作站 PC一台,
控制台电缆一条,双绞线一条,调制解调器两台。
四、“利用异步串行接口对路由器进行远程维护”实验环境
S 1 / 0
2 6 1 1
W o r k s t a t i o n
C O M 1
五、实验步骤
1.将一条串行接口电缆的 DB-60一端与路由器的某个串口相连接。
2.将串行接口电缆的 DB-60的另一端的 EIA/TIA 232 DTE接口同调制解调器自带的 DB-25 EIA/TIA 232的 DCE接口相连。
3.将电话线接入调制解调器的线路入( Line in)接口。
4.配置路由器基本参数。
5.对路由器进行适当的配置使其能接收远程工作站的呼入连接。
6.在工作站端,将调制解调器同 PC机、电话线连接好。
7.在工作站端,新建并配置适当的拨号参数。
8.在工作站端拨号进行测试。
13.6 实验 2 配置路由器作为远程访问服务器一、实验目的掌握路由器作为远程访问服务器的配置方法。
二、实验任务配置路由器作为远程访问服务器为远程用户提供远程接入服务。
三、实验设备路由器 Cisco 2611一台,带有网卡的工作站 PC一台,
控制台电缆一条,双绞线一条,调制解调器两台。
四、“配置路由器作为远程访问服务器”实验环境
S 1 / 0
2 6 1 1
W o r k s t a t i o n
C O M 1
五、实验步骤
1.将一条串行接口电缆的 DB-60一端与路由器的某个串口相连接。
2.将串行接口电缆的 DB-60的另一端的 EIA/TIA 232 DTE接口同调制解调器自带的 DB-25 EIA/TIA 232的 DCE接口相连。
3.将电话线接入调制解调器的线路入( Line in)接口。
4.按照第 3章 3.3节配置路由器基本参数。
5.对路由器进行适当的配置使其能接收远程工作站的呼入连接并为用户分配 IP地址。
6.在工作站端,将调制解调器同 PC机、电话线连接好。
7.在工作站端,新建并配置适当的拨号参数。
8.在工作站端拨号进行测试。
13.7 实验 3 配置路由器间的异步拨号链路一、实验目的掌握配置路由器间的异步拨号链路的方法。
二、实验任务
1.配置路由器间的异步拨号链路。
2.对路由器间的异步拨号链路的工作情况进行诊断三、实验设备路由器 Cisco 2611两台,带有网卡的工作站 PC一台,
控制台电缆一条,双绞线一条,调制解调器两台。
四、“配置路由器间的异步拨号链路”
实验环境分 支 机 构中 心
S 1 / 0,1 9 2,1 6 8,0,2 / 2 4
S 1 / 0,1 9 2,1 6 8,0,1 / 2 4
B R A N C H
C E N T E R
T e l,x x x x x x x
T e l,x x x x x x x
五、实验步骤
1.将一条串行接口电缆的 DB-60一端与分支路由器的某个串口相连接。
2.将与分支路由器相连的串行接口电缆 DB-60的另一端的 EIA/TIA 232 DTE
接口同调制解调器自带的 DB-25 EIA/TIA 232的 DCE接口相连。
3.将一条串行接口电缆的 DB-60一端与中心路由器的某个串口相连接。
4.将与中心路由器相连的串行接口电缆 DB-60的另一端的 EIA/TIA 232 DTE
接口同调制解调器自带的 DB-25 EIA/TIA 232的 DCE接口相连。
5.将两条电话线分别接入两个调制解调器的线路入( Line in)接口。
6.按照第 3章 3.3节配置路由器基本参数。
7.按照 13.4节的步骤对分支路由器和中心路由器进行适当的配置,使其间的链路可以在需要的时候建立连接。
8.在分支路由器端进行测试。
13.8 思考与练习
1.写出异步接口的物理层配置步骤和命令。
2.写出异步接口的网络层配置步骤和命令。
3.练习利用异步串行接口对路由器进行远程维护的配置方法。
4.练习配置路由器作为远程访问服务器的方法。
5.练习配置路由器间的异步拨号链路的方法。
6.练习对异步拨号链路进行诊断的各个命令。