实验六:PPP基本配置与认证
n 实验目的
1、 串行链路上的封装概念。
2、 PPP封装。
3、 掌握PAP认证特点和配置方法。
4、 掌握CHAP认证特点和配置方法。
n 实验要求
给出串行通信基本知识、PPP组成、PAP和CHAP操作和配置。给出PPP配置验证、故障排除的基本命令和基础理论。
n 实验拓扑(可选)
n 实验设备(环境、软件)
路由器三台、串行DCE线缆2条,交叉线2条
n 实验设计到的基本概念和理论
PPP不是专用协议.链路质量管理功能监视链路的质量.PPP 允许同时使用多个网络层协议。PPP 支持认证 PPP 组件:HDLC LCP NCPPPP 允许多个网络层协议在同一通信链路上运行。 对于所使用的每个网络层协议,PPP 都分别使用独立的 NCP。 NCP 包含了功能字段,功能字段中包含的标准化代码用于指示 PPP 封装的网络层协议。
与一次性身份验证的 PAP 不同,CHAP 定期执行消息询问,以确保远程节点仍然拥
有有效的口令值。CHAP 通过使用唯一且不可预测的可变询问消息值提供回送攻击防护功能。
n 实验过程和主要步骤
一、 设备端口地址的分配情况
二、 路由器Router0上的配置
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R0
R0(config)#username R1 password r
R0(config)#interface f0/0
R0(config-if)#ip address 192.168.1.2 255.255.255.0
R0(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R0(config-if)#exit
R0(config)#interface s2/0
R0(config-if)#ip address 10.10.10.1 255.255.255.252
R0(config-if)#encapsulation ppp
R0(config-if)#ppp authentication CHAP
R0(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R0(config-if)#exit
R0(config)#ip route 20.20.20.20 255.255.255.252 s2/0
R0(config)#ip route 192.168.2.0 255.255.255.0 s2/0
R0(config)#end
%SYS-5-CONFIG_I: Configured from console by console
R0#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R0#
三、 路由器Router1上的配置
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#username R0 password r
R1(config)#username R2 password r
R1(config)#interface s2/0
R1(config-if)#ip address 10.10.10.2 255.255.255.252
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication CHAP
R1(config-if)#clock rate 9600
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
R1(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R1(config)#interface s3/0
R1(config-if)#ip address 20.20.20.22 255.255.255.252
R1(config-if)#clock rate 9600
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication CHAP
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial3/0, changed state to up
R1(config-if)#exit
R1(config)#ip r
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
% Incomplete command.
R1(config)#ip route 192.168.1.0 255.255.255.0 s2/0
R1(config)#ip route 192.168.2.0 255.255.255.0 s3/0
R1(config)#end
%SYS-5-CONFIG_I: Configured from console by console
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
四、 路由器Router2上的配置
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#username R1 password r
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#interface s3/0
R2(config-if)#ip address 20.20.20.21 255.255.255.252
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication CHAP
R2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial3/0, changed state to down
R2(config-if)#exit
R2(config)#ip route 10.10.10.0 255.255.255.252 s3/0
R2(config)#ip route 192.168.1.0 255.255.255.0 s3/0
R2(config)#end
%SYS-5-CONFIG_I: Configured from console by console
R2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R2#
五、 查看并验证配置
在PC1上向PC0发送消息
n 心得体会
通过这次的试验我懂得了如何实现在路由器上配置PPP协议,以及PPP协议的特点及其属性,了解了PPP协议的重要性及其工作过程,同时也知道了PPP协议的体系结构与功能。在这次试验中也不是很顺利的,刚开始的时候只有一半可以通信,通过分析知道是用户的认证密码没有配置成一致的,因此无法在别的路由器中认证。
第二篇:实验一:PPP基本配置与认证
PPP基本配置与认证
n 实验目的
1、 串行链路上的封装概念。
2、 PPP封装。
3、 掌握PAP认证特点和配置方法。
4、 掌握CHAP认证特点和配置方法。
n 实验要求
给出串行通信基本知识、PPP组成、PAP和CHAP操作和配置。给出PPP配置验证、故障排除的基本命令和基础理论。
实验拓扑
n 实验设备(环境、软件)
路由器三台、串行DCE线缆2条,交叉线2条
n 实验设计到的基本概念和理论
给出PPP的基本组成:通过同步电路和异步电路提供路由器到路由器和主机到网络的连接。Ppp可与多种网络层协议同工作,如IP和王建分组交换(IPX)。PPP还有内置的安全机制,如PAP和CHAP。
PPP3个主要组成部分:
用在点到点链路上封装数据报的HDLC协议;
用于建立,配置和测试数据链路连接的链路控制协议LCP扩展版本;
一系列用于建立和配置各种网络协议的网络层协议的网络控制协议(NCP)。PPP支持同时使用多种网络层协议。
PAP的认证特点:密码认证协议(PAP),是 PPP 协议集中的一种链路控制协议,主要是通过使用 2 次握手提供一种对等结点的建立认证的简单方法,这是建立在初始链路确定的基础上的。
完成链路建立阶段之后,对等结点持续重复发送 ID/ 密码给验证者,直至认证得到响应或连接终止。
PAP 并不是一种强有效的认证方法,其密码以文本格式在电路上进行发送,对于窃听、重放或重复尝试和错误攻击没有任何保护。对等结点控制尝试的时间和频度。该认证方法适用于可以使用明文密码模仿登录远程主机的环境。在这种情况下,该方法提供了与常规用户登录远程主机相似的安全性。
CHAP的认证特点:该协议可通过三次握手周期性的校验对端的身份,可在初始链路建立时完成时,在链路建立之后重复进行。通过递增改变的标识符和可变的询问值,可防止来自端点的重放攻击,限制暴露于单个攻击的时间。
该认证方法依赖于只有认证者和对端共享的密钥,密钥不是通过该链路发送的。
PPP封装:一种封装多协议数据报的方法。PPP 封装提供了不同网络层协议同时在同一链路传输的多路复用技术。PPP 封装精心设计,能保持对大多数常用硬件的兼容性。克服了SLIP不足之处的一种多用途、点到点协议,它提供的WAN数据链接封装服务类似于LAN所提供的封闭服务。所以,PPP不仅仅提供帧定界,而且提供协议标识和位级完整性检查服务。
链路控制协议:一种扩展链路控制协议,用于建立、配置、测试和管理数据链路连接。
网络控制协议:协商该链路上所传输的数据包格式与类型,建立、配置不同的网络层协议。
n 实验过程和主要步骤
步骤一:路由器基本配置
Router(config)#hostname A
A(config)#interface FastEthernet0/0
A(config-if)#ip address 192.168.1.1 255.255.255.0
A(config)#interface Serial2/0
A(config-if)#ip address 10.10.10.2 255.255.255.252
Router(config)#interface Serial2/0
Router(config-if)#ip address 10.10.10.1 255.255.255.252
Router(config-if)#clock rate 64000
Router(config)#interface Serial3/0
Router(config-if)#ip address 20.20.20.1 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
步骤二:配置登录用户名和密码
B(config)#username A password 123456
B(config)#username C password 123456
A(config)#username B password 123456
C(config)#username B password 123456
步骤三: PPP封装
以B为例:
B(config)#int s2/0
B(config-if)#encapsulation ppp
B(config-if)#int s3/0
B(config-if)#encapsulation ppp
步骤四:配置PAP和CHAP认证
B(config)#int s2/0
B(config-if)#ppp authentication pap
B(config-if)#ppp pap sent-username B password 123456
B(config)#int s3/0
B(config-if)#ppp authentication chap
C(config)#int s2/0
C(config-if)#ppp authentication chap
A(config)#int s2/0
A(config-if)#ppp authentication pap
A(config-if)#ppp pap sent-username A password 123456
步骤五:配置路由协议
以B为例:
B(config)#router rip
B(config-router)#version 2
B(config-router)#network 10.10.10.0
B(config-router)#network 20.20.20.0
步骤六:查看并验证配置
B#show int s2/0
LCP Open
Open: IPCP, CDPCP
Last input never, output never, output hang never
Last clearing of "show interface" counters never
5 minute input rate 9 bits/sec, 0 packets/sec
5 minute output rate 6 bits/sec, 0 packets/sec
7 packets input, 364 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
5 packets output, 260 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up
B#show ip route
10.0.0.0/30 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, Serial2/0
20.0.0.0/30 is subnetted, 1 subnets
C 20.20.20.0 is directly connected, Serial3/0
R 192.168.1.0/24 [120/1] via 10.10.10.2, 00:00:14, Serial2/0
R 192.168.2.0/24 [120/1] via 20.20.20.2, 00:00:10, Serial3/0
n 心得体会
本次实验主要学习了PPP连接的配置,以及如何使用身份验证协议PAP或CHAP来确保连接的安全,同时也更加从实践的角度理解了点到点串行通信。