实验拓扑图如下所示
操作步骤:
步骤1:连接网络拓扑图。
步骤2:RouterA基本配置。
Router>enable !进入特权模式
Router#config !进入全局配置模式
Router_config#hostname RouterA !设置路由器名称
RouterA_config#username RouterB password digital !设置用户名和密码
RouterA_config#aaa authentication ppp default local
!设置PPP认证方式为本地用户认证
RrouterA_config#interface s0/1 !进入串口0/1接口模式
RouterA_config_s0/1#ip address 192.168.1.1 255.255.255.0 !设置IP地址
RouterA_config_s0/1#physical-layer speed 64000 !设置时钟频率
RouterA_config_s0/1#no shutdown !开启端口
步骤3:RouterB基本配置。
Router>enable !进入特权模式
Router#config !进入全局配置模式
Router_config#hostname RouterB !设置路由器名称
RrouterB_config#username RrouterA password digital !设置用户名和密码
RrouterB_config#aaa authentication ppp default local
!设置PPP认证方式为本地用户认证
RouterB_config#interface s0/2 !进入串口0/1接口模式
RrouterB_config_s0/2#ip address 192.168.1.2 255.255.255.0 !设置IP地址
RrouterB_config_s0/2#no shutdown !开启端口
步骤4:查看RouterA的接口信息。
RouterA#show ip interface brief !查看路由器A的接口信息
Interface IP-Address Method Protocol-Status
Async0/0 unassigned manual down
Serial0/1 192.168.1.1 manual up
Serial0/2 unassigned manual down
FastEthernet0/0 unassigned manual down
FastEthernet0/3 unassigned manual down
步骤5:测试RouterA与RouterB的连通性。
RouterB#ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
!!!!!
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 20/22/30 ms
步骤6:在RouterA上配置CHAP验证。
RouterA_config#interface s0/1 !进入串口0/1接口模式
RouterA_config_s0/1#encapsulation ppp !封装点对点协议
RouterA_config_s0/1#ppp authentication chap !设置认证方式为CHAP
RrouterA_config_s0/1#ppp chap hostname RouterA !设置发送给对方的用户名
RrouterA_config_s0/1#ppp chap password digital !设置发送给对方的密码
步骤7:查看RouterA的接口信息。
RrouterA#show ip interface brief
Interface IP-Address Method Protocol-Status
Async0/0 unassigned manual down
Serial0/1 192.168.1.1 manual down
Serial0/2 unassigned manual down
FastEthernet0/0 unassigned manual down
FastEthernet0/3 unassigned manual down
步骤8:查看RouterA的串口信息。
RrouterA#show interface s0/1
!查看路由器A的s0/1接口信息
- Serial0/1 is up, line protocol is down
- Mode=Sync DCE Speed=64000
- DTR=UP,DSR=UP,RTS=UP,CTS=UP,DCD=UP
- MTU 1500 bytes, BW 64 kbit, DLY 2000 usec
- Interface address is 192.168.1.1/24
- Encapsulation PPP, loopback not set
- Keepalive set(10 sec)
- LCP Opened
- CHAP Listening -- waiting for remote host to attempt open, Message: 'CHAP:
- Invalid Response'
- IPCP Listening -- waiting for remote host to attempt open
- local IP address: 192.168.1.1 remote IP address: 0.0.0.0
- 60 second input rate 0 bits/sec, 0 packets/sec!
- 60 second output rate 0 bits/sec, 0 packets/sec!
- 71 packets input, 1878 bytes, 3 unused_rx, 0 no buffer
- 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
- 67 packets output, 1766 bytes, 8 unused_tx, 0 underruns
- error: 0 clock, 0 grace
- PowerQUICC SCC specific errors:
- 0 recv allocb mblk fail 0 recv no buffer
- 0 transmitter queue full 0 transmitter hwqueue_full
步骤9:在RouterB上配置CHAP验证
RouterB_config#interface s0/2 !进入串口0/2接口模式
RouterB_config_s0/2#encapsulation ppp !封装点对点协议
RouterB_config_s0/2#ppp authentication chap !设置认证方式为CHAP
RrouterB_config_s0/2#ppp chap hostname RouterB !设置发送给对方的用户名
RouterB_config_s0/2#ppp chap password digital !设置发送给对方的密码
步骤10:查看RouterA的串口信息
RouterA#show interface s0/1 !查看RouterA的s0/1口信息
Serial0/1 is up, line protocol is up
Mode=Sync DCE Speed=64000
DTR=UP,DSR=UP,RTS=UP,CTS=UP,DCD=UP
MTU 1500 bytes, BW 64 kbit, DLY 2000 usec
Interface address is 192.168.1.1/24
Encapsulation PPP, loopback not set
Keepalive set(10 sec)
LCP Opened
CHAP Opened, Message: ' Welcome to Digitalchina Router' !表示认证成功
IPCP Opened
local IP address: 192.168.1.1 remote IP address: 192.168.1.2
60 second input rate 44 bits/sec, 0 packets/sec!
60 second output rate 44 bits/sec, 0 packets/sec!
27 packets input, 701 bytes, 5 unused_rx, 0 no buffer
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
28 packets output, 726 bytes, 8 unused_tx, 0 underruns
error:
0 clock, 0 grace
PowerQUICC SCC specific errors:
0 recv allocb mblk fail 0 recv no buffer
0 transmitter queue full 0 transmitter hwqueue_full