实验27_PPP协议的CHAP验证

合集下载

PPP的CHAP认证和PAP认证

PPP的CHAP认证和PAP认证

PPP的CHAP认证和PAP认证Chap 和pap 认证有很多种,有单项的,有双向的。

单项chap认证。

(R1作为服务器端)R1(config)#interface s4/0R1(config-if)#ip address 192.168.1.1 255.255.255.0R1(config-if)#encapsulation ppp \\封装PPP协议R1(config-if)#ppp authentication chap \\开启认证,认证方式为chap认证R1(config-if)#exitR1(config)#username R2 password 0 123456 \\创建用户R2 ,用于识别认证客户端R2(config)#interface s4/0R2(config-if)#ip address 192.168.1.2 255.255.255.0R2(config-if)#encapsulation ppp \\封装PPP协议R2(config-if)#exitR2(config)#username R1 password 0 123456 \\创建用户R1,用于识别想服务器端单项pap 认证。

(R1作为服务器端)R1(config)#interface s4/0R1(config-if)#ip address 192.168.1.1 255.255.255.0R1(config-if)#encapsulation ppp \\封装PPP协议R1(config-if)#ppp authentication pap \\开启认证,认证方式为pap (服务器断开启)R1(config-if)#exitR1(config)#username R2 password 0 123456 \\创建的用户为客户端的主机名R2(config)#interface s4/0R2(config-if)#ip address 192.168.1.2 255.255.255.0R2(config-if)#encapsulation pppR2(config-if)#ppp pap sent-username R2 password 0 123456 \\定义客户端所要发送的用户名和密码,一般是发送跟自己主机名一样的的用户。

PPP协议原理实验指导书

PPP协议原理实验指导书
身份验证密码正确 1. 运行服务器,选择合适的串口,波特率设为 9600。 2. 选中要求身份验证选项,设置用户名和密码。 3. 运行客户机,选择合适的串口,波特率设为 9600。 4. 单击“LCP 过程”按钮,在弹出菜单中单击“建立 LCP 连接”按钮,当提
示输入用户名和密码的时候,输入正确的密码(同服务器上设置的用户名 和密码一样),观察程序输出并做记录。
4. LCP 的格式 LCP 分组的格式如下图所示。传输时从左到右依次传输。
Code 字段为一个字节,它表明了 LCP 分组的类型,在 Assigned Numbers 中指
明了常用的 LCP Code 值所代表的分组类型,现在列于下:
LCP 分组的类型
1
Configure-Request
2
Configure-Ack
z Link Dead 阶段 Link Dead 阶段是 PPP 链路的起始和终止阶段。当发生外部事件指示物理 层已就绪后,PPP 将进入到 Link Establishment 阶段。
z Link Establishment 阶段 LCP 通过交换 Configure 分组来建立连接,如果链路建立成功,则进入 Authentication 阶 段 , 否 则 进 入 Link Dead 阶 段 。 当 发 送 了 Lcp Config-Request 之后,如果在一定的时间内没有收到任何相应,那么就重 发 Lcp 连接请求报文,如果重发次数超过一规定次数后,则视为连接失败。 超时时间和重试次数都可以认为设定。
5. NCP 的工作过程 建立 NCP 连接 1) 此实验要求已经成功建立 LCP 连接。 2) 单击“NCP 过程”按钮,在弹出菜单中单击“建立 IPCP 连接”按钮,观 察程序输出并做记录。

补充实验路由器接口PPP协议封装及PAP、CHAP验证

补充实验路由器接口PPP协议封装及PAP、CHAP验证

补充实验:路由器接口PPP协议封装及PAP、CHAP验证
一、实验目的
1. 理解点对点PPP的广域网接入技术
2. 理解PPP链路中的PAP与CHAP验证的区别
3. 掌握PAP验证的配置方法
4. 掌握CHAP验证的配置方法
二、实验环境及主要操作步骤
1、PAP验证
以上两台路由器的IP地址按照图示自行配置,路由器接口PPP协议封装及PAP身份验证配置结束之后,利用Ping命令测试两机能否相互通信。

2、CHAP验证
以上两台路由器的IP地址按照图示自行配置,路由器接口PPP协议封装及CHAP身份验证配置结束之后,利用Ping命令测试两机能否相互通信。

每位同学提交实验文档:PPP-XX.pkt(XX代表号数)。

PPP协议帧格式及验证

PPP协议帧格式及验证
PPP协议帧格式及验证
PPP帧格式
1Byte 1Byte 1Byte 2Bytes 2Bytes 1Byte
0x7E 0xFF 0x03 协议域
信息域
帧校验
0x7E
信息域:根据协议域的内容而定 控制域:通常用0x03填充 当协议域为LCP协议时,信息域内为LCP协商参数 地址域:对方的数据链路层地址。 标志字节:用来标示PPP帧的开始和结 协议域:用来区分PPP数据帧中信息域所承载的数据报文的内容 当协议域为NCP协议时,信息域内为NCP协商参数 束 因为PPP协议是点对点的链路层协议,所 常见取值: 当协议域为IP协议时,信息域内为用户数据 以此字节无意义,用0xFF填充 0xc021 信息域中承载的是LCP协议数据报文 0xc023 信息域中承载的是PAP协议的认证报文 0xc223 信息域中承载的是CHAP协议的认证报文 0x8021 信息域中承载的是NCP协议数据报文 0x0021 信息域中承载的是IP协议数据报文
Page 2/34
PAP认证
PAP是两次握手认证协议,口令以明文传送,被认 证方首先发起认证请求。
用户名和密码(user01/pw01) 认证通过/未通过
根据用户数据库认证 用户名密码是否正确 用户名:user01 密 码:pw01 username password user01 pw01
被认证方
主P认证
CHAP是三次握手认证协议,不发送口令,主认证 方首先发起认证请求,安全性比PAP高。
被认证方
主认证方
Page 4/34
CHAP认证
主认证方发送认证请求
表示此报文为认 此次认证的序列 主认证方认证用 户名 证请求 号 01 id 随机数据 3640-1 被认证方在本地 的数据库中查找 对应的密码 MD5 id 随机数据 PWD

PPP中的pap和chap认证

PPP中的pap和chap认证

PPP中的pap和chap认证写在前面:今天看了victoryan兄弟的chap认证实验,想起来以前帮忙同学解决了一个关于pap和chap认证的问题,现在就把ppp中的pap和chap认证做一个总结。

实验等级:Aassistant实验拓扑:实验说明:PPP中的认证方式有pap和chap两种,这两种认证既可以单独使用也可以结合使用。

并且既可以进行单向认证也可以进行双向认证。

pap是通过验证远端的用户名和密码是否匹配来进行验证chap则是发送一个挑战包,然后远端通过自己的数据库的用户名和密码利用md5进行计算后返还一个数值,然后在发送方验证这个数值是否和自己计算出来的数值是否一致进行验证基本配置:R1:!hostname R1----------------------------------------------------------设置主机名为“R1”!interface Serial1/0ip address 1.1.1.1 255.255.255.0encapsulation ppp-------------------------------------------------设置封装为pppR2:hostname R2!interface Serial1/0ip address 1.1.1.2 255.255.255.0encapsulation ppp通过上面的配置,在没有启用任何认证的情况下,链路是通的。

配置步骤:1.在两台路由器上进行pap认证:如果我们进行单项认证的话配置应该如下R1为认证的服务器端,需要建立本地口令数据库,并且开始pap认证。

R1(config)#username R2 password gairuhe------------------------建立本地口令数据库R1(config)#int s1/0R1(config-if)#ppp authentication pap--------------------------------要求进行PAP认证在这样的配置下,我们可以看到链路已经down了:R1(config-if)#*Aug 23 16:45:12.639: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ser ial1/0, changed state to downR2为认证的客户端,需要发送用户名和密码来匹配服务器端的口令数据库此时我们在R2上加上如下的配置:R2(config)#int s1/0R2(config-if)#ppp pap sent-username R2 password gairuhe------发送用户名和密码R2(config-if)#*Aug 23 16:47:48.635: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ser ial1/0, changed state to up此时链路已经起来,我们仅在R1上做了认证,而在R2上没有进行认证。

PPP认证实验

PPP认证实验
R2#
R3#ping10.1.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to10.1.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/27/48 ms
Conversations 0/1/256 (active/max active/max total)
Reserved Conversations 0/0 (allocated/max allocated)
Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
91 packets output, 6909 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 output buffer failures, 0 output buffers swapped out
2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up
*Mar 1 00:05:12.687: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
*Mar 1 00:05:13.691: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

PPP会话建立过程及CHAP验证过程

PPP会话建立过程及CHAP验证过程

PPP 会话建立过程一个完整的ppp 会话建立大体需要以下三步:1、链路建立阶段:在这个阶段,运行PPP 的设备会发送LCP 报文来检测链路的可用情况,如果链路可用则会成功建立链路,否则链路建立失败。

2、验证阶段(可选):链路成功建立后,根据PPP 帧中的验证选项来决定是否验证。

如果需要验证,则开始PPP 或者CHAP 验证,验证成功后开始网络协商阶段。

3、网络层协商阶段:运行PPP 的双方发送NCP 报文来选择并配置网络层协议,双方会协商彼此使用的网络层协议(例如是IP 或者是IPX ),同时也会选择对应的网络层地址(如IP 地址或IPX 地址)。

如果协商通过则PPP 链路建立成功。

PPP 会话流程PPP 会话流PSTN/ISTN ROUTER-A ROUTER-B 链路的建立和配置协调阶段 可选的验证阶段,选择PAP 或者CHAP 网络层协议配置协商阶段Establish 阶段 Dead 阶段 链路建立失败 Authenticate 阶段 Network 阶段Terminate 阶段LCP Opened验证失败 验证通过或 无验证 关闭 Down详细的PPP会话建立流程如下:1、当物理层不可用时,PPP链路处于Dead阶段,链路必须从这个阶段开始和结束。

2、当物理层可用是进入Establish阶段。

PPP链路在Establish阶段进行LCP协商,协商的内容包括是否采用链路捆绑、使用哪种验证方式、最大传输单元等。

协商成功后LCP进入Opened状态,表示底层链路已经建立。

3、如果配置了验证,则进入Authenticate阶段,开始CHAP或者PPP验证。

4、如果验证失败则进入Terminate阶段,拆除链路,LCP状态转为Down;如果验证成功则进入Network阶段,有NCP协商网络层协议参数,此时LCP状态仍为Opened,而NCP状态从Initial转到Request。

5、NCP协商支持IPCP协商,IPCP协商主要包括双方的IP地址。

实验二十三:PPP协议中的CHAP和PAP验证

实验二十三:PPP协议中的CHAP和PAP验证

实验二十三:PPP协议中的CHAP和PAP验证一、理论基础1. PPP协议PPP协议是在SLIP(Serial Line IP串行线IP协议)的基础上发展起来的。

由于SLIP 协议只支持异步传输方式、无协商过程(尤其不能协商如双方IP地址等网络层属性)等缺陷,在以后的发展过程中,逐步被PPP协议所代替。

人们创建了PPP协议以解决远程互连网的连接问题。

另外,需要采用PPP协议来解决动态分配IP地址以及多协议使用的问题。

PPP 可以在同步和异步电路中提供路由器到路由器以及主机到网络的连接。

PPP是目前使用最普遍、最流行的WAN协议,是一种标准的串行线路封装方式,这种协议在连接建立期间可以检查链路的质量。

2、PPP协议的特点(1)动态分配IP地址(例如拨号上网时)(2)支持多种网络层协议(3)误码检测(4)多链路绑定(Multilink)(5)数据的压缩(6)链路配置以及链路质量测试(7)回叫(Callback)(8)网络能力的协商选项,如:网络层地址协商和数据压缩协商等PPP定义了一整套的协议,包括链路控制协议(LCP)、网络层控制协议(NCP)和验证协议(PAP和CHAP)等。

其中,链路控制协议LCP(Link Control Protocol):用来协商链路的一些参数,负责创建并维护链路。

网络层控制协议NCP(Network Control Protocol):用来协商网络层协议的参数。

3、PPP建立一个点到点连接的四个阶段(1)链路的建立和配置协商(2)链路质量确定(3)网络层协议配置协商(4)链路拆除4、 PPP的验证方式PAP验证PAP(Password Authentication Protocol,口令鉴定协议)是一种两次握手验证协议,它在网络上采用明文方式传输用户名和口令。

PAP验证的过程如下:被验证方主动发起验证请求,将本端的用户名和口令发送到验证方;验证方接到被验证方的验证请求后,检查此用户名是否存在以及口令是否正确。

PPP CHAP认证

PPP CHAP认证

【实验名称】PPP CHAP认证。

【实验目的】掌握PPP CHAP认证的过程及配置。【背景描述】你是公司的网络管理员,公司为了满足不断增长的业务需求,申请了专线接入,你的客户端路由器与ISP进行链路协商时要验证身份,配置路由器保证链路建立并考虑其安全性。

【技术原理】PPP协议位于OSI七层模型的数据链路层,PPP协议按照功能划分为两个子层:LCP、NCP。

LCP主要负责链路的协商、建立、回拨、认证、数据的压缩、多链路捆绑等功能。

NCP主要负责和上层的协议进行协商,为网络层协议提供服务。

PPP的认证功能是指在建立PPP链路的过程中进行密码的验证,验证通过建立连接,验证不通过拆除链路。

CHAP(Challenge Handshake Authentication Protocol,挑战式握手验证协议)是指验证双方通过三次握手完成验证过程,比PAP更安全。

由验证方主动发出挑战报文,由被验证方应答。

在整个验证过程中,链路上传递的信息都进行了加密处理。

【实现功能】在链路协商时保证安全验证。

链路协商时密码以密文的方式传输,更安全。

【实验设备】R1762(两台)、V.35线缆(1条)【实验拓扑】图 24【实验步骤】步骤1. 基本配置。

Red-Giant(config)#hostname RaRa(config)# interface serial 1/2Ra(config-if)#ip address 1.1.1.1 255.255.255.0Ra(config-if)#no shutdownRed-Giant(config)#hostname RbRb(config)# interface serial 1/2Rb(config-if)#ip address 1.1.1.2 255.255.255.0Rb(config-if)#clock rate 64000Rb(config-if)#no shutdown验证测试: (以Ra为例)Ra#show interface serial 1/2serial 1/2 is UP , line protocol is UPHardware is PQ2 SCC HDLC CONTROLLER serialInterface address is: 1.1.1.1/24MTU 1500 bytes, BW 2000 KbitEncapsulation protocol is HDLC, loopback not setKeepalive interval is 10 sec , setCarrier delay is 2 secRXload is 1 ,Txload is 1Queueing strategy: WFQ5 minutes input rate 11 bits/sec, 0 packets/sec5 minutes output rate 11 bits/sec, 0 packets/sec33 packets input, 726 bytes, 0 no bufferReceived 33 broadcasts, 0 runts, 0 giants0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort32 packets output, 704 bytes, 0 underruns0 output errors, 0 collisions, 6 interface resets3 carrier transitionsV35 DTE cableDCD=up DSR=up DTR=up RTS=up CTS=up步骤2. 配置PPP CHAP认证。Ra(config)#username Rb password 0 star! 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)#interface serial 1/2Ra(config-if)#encapsulation pppRa(config-if)#ppp authentication chap ! PPP启用CHAP方式验证Rb(config)#username Ra password 0 star! 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)#interface serial 1/2Rb(config-if)# encapsulation ppp验证测试:Ra#debug ppp authentication ! 观察CHAP验证过程%LINK CHANGED: Interface serial 1/2, changed state to down%LINE PROTOCOL CHANGE: Interface serial 1/2, changed state to DOWNPPP: ppp_clear_author(), protocol = TYPE_LCP%LINK CHANGED: Interface serial 1/2, changed state to upPPP: serial 1/2 Send CHAP challenge id=29 to remote hostPPP: serial 1/2 authentication event enqueue ,message type = [RECV_CHAP_RESPONSE] PPP: dispose authentication message [RECV_CHAP_RESPONSE]PPP: serial 1/2 CHAP response id=29 ,received from RbPPP: serial 1/2 Send CHAP success id=29 to remotePPP: serial 1/2 remote router passed CHAP authentication.PPP: serial 1/2 lcp authentication OK!PPP: ppp_clear_author(), protocol = TYPE_IPCP%LINE PROTOCOL CHANGE: Interface serial 1/2, changed state to UP【注意事项】1、在DCE端要配置时钟;2、Ra(config)#username Rb password 0 star !username后面的参数是对方的主机名;3、Rb(config)#username Ra password 0 star !username后面的参数是对方的主机名;4、在接口下封装ppp;5、debug ppp authentication 在路由器物理层up,链路尚未建立的情况下打开才有信息输出,本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。

PPP协议配置(CHAP验证).

PPP协议配置(CHAP验证).

实训3.2PPP协议配置(CHAP验证)【实训目的】掌握MP协议的配置方法和用途【背景描述】【实现功能】【实训设备】●1台H3C AR28-11路由器,1台H3C AR28-12路由器;●1台H3C S2126交换机(或者1台H3C E328交换机);●2-4台计算机,Windiwos XP操作系统,安装超级终端程序;●1条Cosole电缆(RJ45-DB9型);●4条直通双绞线;1条路由器背靠背连接电缆(1条V35DCE,1条V35DTE【实训拓扑】路由器各接口IP地址配置RouterA RouterB Ethernet0/0192.168.10.1192.168.20.1Serial0/0192.168.15.1/24192.168.15.2/24PC机的IP地址和缺省网关的配置PCA PCB IP Address192.168.10.20192.168.20.22Gateway192.168.10.1192.168.20.1【实训步骤】1. 路由器H3C AR28-11配置#<H3C>system#[H3C]sysname RouterA##配置接口IP地址#[RouterA]interface Ethernet 0/0[RouterA-Ethernet0/0]ip address 192.168.10.1 255.255.255.0 [RouterA-Ethernet0/0]undo shutdown[RouterA-Ethernet0/0]quit#[RouterA]interface Serial 0/0[RouterA-Serial0/0]ip address 192.168.15.1 255.255.255.0 [RouterA-Serial0/0]undo shutdown[RouterA-Serial0/0]quit##配置RIP协议#[RouterA]rip[RouterA-rip]network 192.168.10.0[RouterA-rip]network 192.168.15.0[RouterA-rip]quit#[SwitchA]2. 路由器H3C AR28-12配置#<H3C>system#[H3C]sysname RouterB##配置接口IP地址#[RouterB]interface Ethernet 0/0[RouterB-Ethernet0/0]ip address 192.168.20.1 255.255.255.0 [RouterB-Ethernet0/0]undo shutdown[RouterB-Ethernet0/0]quit#[RouterB]interface Serial 0/0[RouterB-Serial0/0]ip address 192.168.15.2255.255.255.0[RouterB-Serial0/0]undo shutdown[RouterB-Serial0/0]quit##配置RIP协议#[RouterB]rip[RouterB-rip]network 192.168.20.0[RouterB-rip]network 192.168.15.0[RouterB-rip]quit#[SwitchB]2.配置CHAP2.1 单向CHAP验证(路由器B为主验证方)#路由器H3C AR28-11配置#[RouterA] local-user rtb #创建用来验证的本地帐号[RouterA-luser-rtb] password simple 123 #设置帐号密码[RouterA-luser-rtb] service-type ppp #设置服务类型为ppp [RouterA-luser-rtb]quit#[RouterA]interface Serial 0/0[RouterA-Serial0/0]ppp chap user rta #CHAP认证帐号[RouterA-Serial0/0]undo shutdown[RouterA-Serial0/0]quit##路由器H3C AR28-12配置#[RouterB] local-user rta #创建用来验证的本地帐号[RouterB-luser-rta] password simple 123 #设置帐号密码[RouterB-luser-rta] service-type ppp #设置服务类型为ppp [RouterB-luser-rta]quit#[RouterB]interface Serial 0/0[RouterB-Serial0/0] ppp authentication-mode chap #使能CHAP验证[RouterB-Serial0/0]ppp chap user rtb #CHAP认证帐号[RouterB-Serial0/0]undo shutdown[RouterB-Serial0/0]quit#。

ppp,协议的chap,认证之间发送的协议

ppp,协议的chap,认证之间发送的协议

竭诚为您提供优质文档/双击可除ppp,协议的chap,认证之间发送的协议篇一:点对点ppp协议chap认证实验点对点ppp协议chap认证一、实验目的和要求了解点对点协议(ppp)的工作原理掌握ppp协议两种认证方式的特点和区别掌握ppp协议的配置以及chap认证协议的配置二、实验设备模拟软件:ciscopackettracer53_setup_no_tutorials 设备:路由器2台,串口线一根三、实验内容在两台路由器上配置ppp协议,采用chap验证方式,在链路协商时保证安全验证。

具体包括chap单向和双向认证。

四、实验拓扑图1chap认证五、背景描述你是公司的网络管理员,公司为了满足不断增长的业务需求,申请了专线接入,你的客户端路由器与isp进行链路协商时要验证身份,并要求较高的安全性。

六、相关知识1、ppp协议点到点协议(pointtopointprotocol,ppp)是ietF (inteirnetengineeringtaskforce,因特网工程任务组)推出的点到点类型线路的数据链路层协议。

它解决了slip中的问题,并成为正式的因特网标准。

ppp支持在各种物理类型的点到点串行线路上传输上层协议报文。

ppp有很多丰富的可选特性,如支持多协议、提供可选的身份认证服务、可以以各种方式压缩数据、支持动态地址协商、支持多链路捆绑等等。

这些丰富的选项增强了ppp的功能。

同时,不论是异步拨号线路还是路由器之间的同步链路均可使用。

因此,应用十分广泛。

ppp提供了两种可选的身份认证方法:口令验证协议pap (passwordauthenticationprotocol,pap)和质询握手协议(challengehandshakeauthenticationprotocol,chap)。

如果双方协商达成一致,也可以不使用任何身份认证方法。

2、chap验证原理chap是一个过程复杂的、安全的身份验证协议。

PPP之CHAP验证

PPP之CHAP验证

实验二十四:PPP之CHAP验证CHAP(Challenge Handshake Authentication Protocol,质询握手鉴定协议)是一种三次握手验证协议,它只在网络上传输用户名,而用户口令并不在网络上传播,因此,其安全性能强。

默认情况下,CHAP使用本地路由器的名称为建立PPP连接时的识别符,因此,必须为网络中所有路由器重新命名,并且路由器名称不能重复。

在各路由器中设置用户名及密码时要注意,用户名必须是对方路由器的名称(该用户名将会自动发送到对方路由器中),而且各路由器中用户的密码必须相同。

一、实验内容某公司两地的Cisco路由器用DDN线路连接起来,方了安全,要在路由器配置PPP封装,并采用CHAP验证,使得两地的网络能够安全通信。

二、实验目的1、了解PPP之CHAP的工作过程2、掌握PPP之CHAP的配置三、网络拓朴四、实验设备1、两台Cisco3620路由器(带一个以太网接口和一个同步serial0/0串口)2、两台安装有windows98/xp/2000操作系统的主机3、若干交叉网线与直通网线4、思科(Cisco)专用控制端口连接电缆5、思科(Cisco)串口背对背通信电缆五、实验过程(需要将相关命令写入实验报告)1、将路由器、主机根据如上图示进行连接2、设置主机的IP地址、子网掩码和默认网关3、配置RouterA的以太网接口Router#configure terminalRouter(config)#hostname RouterARouterA(config)#interface Ethernet0/0RouterA(config-if)#ip address192.168.1.1255.255.255.0RouterA(config-if)#no shutdownRouterA(config-if)#exit4、配置RouterB的以太网接口Router#configure terminalRouter(config)#hostname RouterBRouterA(config)#interface Ethernet0/0RouterA(config-if)#ip address192.168.3.1255.255.255.0RouterA(config-if)#no shutdownRouterA(config-if)#exit5、配置RouterA的同步串行接口RouterA#configure terminalRouterA(config)#interface serial0/0RouterA(config-if)#ip address192.168.2.1255.255.255.0RouterA(config-if)#no shutdownRouterA(config-if)#exit6、配置RouterB的同步串行接口RouterB#configure terminalRouterB(config)#interface serial0/0RouterB(config-if)#ip address192.168.2.2255.255.255.0RouterB(config-if)#no shutdownRouterB(config-if)#exit7、DCE设备端(RouterA)PPP封装之CHAP验证设置(关键配置)RouterA#configure terminalRouterA(config)#username RouterB password12345RouterA(config)#interface serial0/0RouterA(config-if)#encapsulation pppRouterA(config-if)#ppp authentication chapRouterA(config-if)#clock rate64000RouterA(config-if)#exit8、DTE设备端(RouterB)PPP封装之CHAP验证设置(关键配置)RouterB#configure terminalRouterB(config)#username RouterA password12345RouterB(config)#interface serial0/0RouterB(config-if)#encapsulation pppRouterB(config-if)#ppp authentication chapRouterB(config-if)#exit9、查看各路由器接口状态(所有接口必须全部UP,且配置的协议也已经UP)RouterA#show protocolsRouterB#showprotocols10、配置RouterA的RIP简单路由协议RouterA#configure terminalRouterA(config)#router ripRouterA(config-router)#network192.168.1.0RouterA(config-router)#network192.168.2.0RouterA(config-router)#exit11、配置RouterB的RIP简单路由协议RouterB#configure terminalRouterB(config)#router ripRouterB(config-router)#network192.168.2.0RouterB(config-router)#network192.168.3.0RouterB(config-router)#exit六、思考问题1、与PAP验证相比,CHAP验证具有哪些优点?2、在配置PPP之CHAP验证时,两端路由器的用户名及密码应如何设置?七、实验报告要求:按学院实验报告要求完成实验报告的书写。

PPP协议及验证机制

PPP协议及验证机制

PPP协议及验证机制Chapter One: IntroductionPPP (Point-to-Point Protocol) is a widely used protocol that enables communication between two computers through a serial connection. It is commonly used in internet service provider (ISP) networks to establish a connection between the customer's computer and the ISP's network. PPP offers several advantages over earlier protocols, such as SLIP (Serial Line Internet Protocol), including support for authentication, encryption, and compression.The purpose of this article is to explore the PPP protocol in-depth, particularly its authentication and validation mechanism.Chapter Two: PPP Protocol OverviewPPP operates at the data link layer and is used to encapsulate network layer protocols such as IP (Internet Protocol) and IPv6 (Internet Protocol version 6). During the transmission of data, PPP adds its own header and trailer to the data packets. The PPP header consists of a one-byte flag, an address field, a control field, and a protocol field.The trailer consists of a two-byte CRC (Cyclic Redundancy Check) field.The PPP protocol supports several options, including compression and encryption. It also supports authentication methods that enable the client and the server to verify each other's identity before data transmission is initiated.Chapter Three: Authentication MechanismPPP authentication is used to ensure that only authorized users can establish a connection. PPP supports three authentication methods: Password Authentication Protocol (PAP), Challenge Handshake Authentication Protocol (CHAP), and Microsoft Challenge Handshake Authentication Protocol (MS-CHAP).Password Authentication Protocol (PAP)PAP is the simplest authentication protocol supported by PPP. It involves the transmission of a clear-text password from the client to the server. The server checks the password against its database and either accepts or rejects the connection.PAP is not considered a secure authentication method since the password is sent in clear text and can be easily intercepted. However, it is easy to implement and can be useful in some situations.Challenge Handshake Authentication Protocol (CHAP)CHAP is a more secure authentication protocol that uses a challenge-response mechanism. When the connection is initiated, the server sends a challenge message to the client. The client uses a one-way hash function (such as MD5) to encrypt the challenge message with its password, producing a response message. The client sends the response message to the server, which then checks the response message against its database. If the response message matches the expected value, the server accepts the connection.CHAP is considered more secure than PAP since the password is never sent in clear text. However, it requires more processing power since both the client and server need to perform encryption and decryption.Microsoft Challenge Handshake Authentication Protocol (MS-CHAP)MS-CHAP is an extension of CHAP developed by Microsoft. It provides additional security by using a stronger encryption algorithm (such as DES) and by incorporating mutual authentication. In mutual authentication, both the client and the server authenticate each other before the data transmission is initiated.Chapter Four: PPP Validation MechanismPPP validation is used to ensure that the data transmitted between the client and the server is not altered during transmission. PPP supports two validation methods: Link Control Protocol (LCP) and PPP Authentication Protocol (PAP).Link Control Protocol (LCP)LCP is used to establish, configure, and test the connection between the client and the server. During the connection setup, LCP negotiates configuration options and verifies that the connection is functioning properly. LCP also provides error detection by using CRC.PPP Authentication Protocol (PAP)PAP can also be used for validation purposes. When PAP is usedfor validation, it is referred to as CHAP with Validation (CHAP-V). In CHAP-V, the client and the server authenticate each other using CHAP. After the connection is established, the client periodically sends validation requests to the server, which responds with a validation message. If the validation message matches the expected value, the connection continues. If the validation message does not match the expected value, the connection is terminated.Chapter Five: ConclusionPPP is a widely used protocol that enables communication between two computers through a serial connection. It offers several advantages over earlier protocols, including support for authentication, encryption, and compression. PPP supports three authentication methods: PAP, CHAP, and MS-CHAP, and two validation methods: LCP and PAP. By using PPP's authentication and validation mechanisms, it is possible to establish secure and reliable connections between computers.。

PPP协议及验证机制

PPP协议及验证机制

PPP协议及验证机制PPP协议(Point-to-Point Protocol)是一种数据链路层协议,它是为在同等单元之间传输数据包这样的简单链路而设计的。

这种链路提供全双工操作,并按照顺序传递数据包。

PPP为基于各种主机、网桥和路由器的简单连接提供一种共通的解决方案。

PPP协议包括以下三个部分:1.数据帧封装方法。

2.链路控制协议LCP(Link Control Protocol):它用于对封装格式选项的自动协商,建立和终止连接,探测链路错误和配置错误。

3.针对不同网络层协议的一族网络控制协议NCP(Network Control Protocol): PPP协议规定了针对每一种网络层协议都有相应的网络控制协议,并用它们来管理各个协议不同的需求。

PPP协议简介1. PPP数据帧封装PPP协议为串行链路上传输的数据报定义了一种封装方法,它基于高层数据链路控制(HDLC)标准。

PPP数据帧的格式如图1所示。

PPP帧以标志字符01111110开始和结束,地址字段长度为1字节,内容为标准广播地址11111111,控制字段为00000011。

协议字段长度为2个字节,其值代表其后的数据字段所属的网络层协议,如:0x0021代表IP协议,0xC021代表LCP数据,0x8021代表NCP数据等。

数据字段包含协议字段中指定的协议的数据报,长度为0~1500字节。

CRC字段为整个帧的循环冗余校验码,用来检测传输中可能出现的数据错误。

即使使用所有的帧头字段,PPP协议帧也只需要8个字节就可以形成封装。

如果在低速链路上或者带宽需要付费的情况下,PPP协议允许只使用最基本的字段,将帧头的开销压缩到2或4个字节的长度,这就是所谓的PPP帧头压缩。

2. PPP回话的四个阶段一次完整的PPP回话过程包括四个阶段: 链路建立阶段、确定链路质量阶段、网络层控制协议阶段和链路终止阶段(如图2所示)。

(1) 链路建立阶段:PPP通信双方用链路控制协议交换配置信息,一旦配置信息交换成功,链路即宣告建立。

9.PPP各种验证

9.PPP各种验证

PPP验证1)PAP验证2次握手,密码以明文方式发送。

iii)验证方返回验证结果(通过或拒绝)。

2)CHAP验证3次握手,密码没有明文发送。

i)首先由验证方发送用户名和Challengeii)接着被验证方将用户名和使用Challenge(随机字符串)MD5iii)验证方返回验证结果(通过或拒绝)R1使用PAP验证R2设置R1使用PAP验证对端R2:int s0/0在R1上开启debug ppp authentication查看PPP PAP的验证过程,观察到PAP的2次握手(其中I AUTH-REQ表示R1收到来自R2发来PAP 验证消息,而O AUTH-ACK则是R1回应的PAP验证通过消息)R1#*Mar 1 00:01:17.755: Se0/0 PPP: Sent PAP LOGIN Request*Mar 1 00:01:17.759: Se0/0 PPP: Received LOGIN Response PASS*Mar 1 00:01:17.763: Se0/0 PPP: Sent LCP AUTHOR Request*Mar 1 00:01:17.767: Se0/0 PPP: Sent IPCP AUTHOR Request*Mar 1 00:01:17.771: Se0/0 LCP: Received AAA AUTHOR Response PASSR1#*Mar 1 00:01:18.775: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upR1使用CHAP验证R2R1:hostname R1username chap_R2 password chap_passint s0/0encapsulation pppppp authentication chap 设置R1使用CHAP验证对端R2:int s0/0encapsulation pppppp chap hostname chap_R2ppp chap password chap_pass在R1上开启debug ppp authentication 查看PPP CHAP 的验证过程,观察到CHAP 的3次握手(其中O CHALLENGE 表示R1发送出的主机名和随机字符串,而I RESPONSE 则是R2回应的CHAP 验证消息--包括用户名和加密后的密码,O SUCCESS 为R1回应的CHAP 验证成功消息) R1# *Mar 1 00:14:47.887: Se0/0 CHAP: O CHALLENGE id 1 len 23 from "R1"*Mar 1 00:14:47.955: Se0/0 CHAP: I RESPONSE id 1 len 28 from "chap_R2" *Mar 1 00:14:47.959: Se0/0 PPP: Sent CHAP LOGIN Request*Mar 1 00:14:47.963: Se0/0 PPP: Received LOGIN Response PASS *Mar 1 00:14:47.971: Se0/0 PPP: Sent LCP AUTHOR Request*Mar 1 00:14:47.971: Se0/0 PPP: Sent IPCP AUTHOR Request *Mar 1 00:14:47.975: Se0/0 LCP: Received AAA AUTHOR Response PASS*Mar 1 00:14:47.979: Se0/0 IPCP: Received AAA AUTHOR Response PASS *Mar 1 00:14:47.979: Se0/0 CHAP: O SUCCESS id 1 len 4R1使用CHAP 验证R2 R1: hostname R1username chap_R2 password cisco int s0/0 encapsulation ppp ppp authentication chap 设置R1使用CHAP 验证对端 R2:hostname R2 username R1 passwod cisco注1:在CHAP 验证中,如果验证方R1发送的用户名在R2上配置了对应的username ,则R2回应时将使用此username 对应的密码回应;否则使用接口下ppp chap password 命令设置的密码。

26 配置和检验 PAP 身份验证与 CHAP 身份验证

26 配置和检验 PAP 身份验证与 CHAP 身份验证

实验26配置和检验PAP 身份验证与CHAP 身份验证目标:●使用PAP 和CHAP 配置PPP 身份验证。

●使用show 和debug 命令检验连通性。

背景/准备工作参照拓扑图,搭建一个类似的网络。

本实验可使用具有一个串行接口的任何路由器。

例如,可以使用800、1600、1700、1800、2500、2600 或2800 系列路由器或其任意组合。

本实验的说明信息同样适用于其它路由器;但命令语法可能会有所差异。

根据路由器的型号,接口标识可能也不同。

例如,有些路由器上的Serial0 可能是Serial0/0 或Serial0/0/0,而Ethernet0 可能是FastEthernet0/0。

本实验的说明信息同样适用于使用Serial 0/0/0 接口表示方法的路由器。

如果使用不同的路由器,请相应使用串行接口的正确表示方法。

本实验需要以下资源:●具有串行连接的两台路由器●两台基于Windows 的计算机,每台都装有终端仿真程序●至少一根RJ-45 转DB-9 连接器控制台电缆,用于配置路由器●一根两段式(DTE/DCE) 串行电缆步骤 1:连接设备按照拓扑图所示,使用串行电缆连接Router 1 和Router 2 两台路由器的Serial 0/0/0 接口。

步骤 2:在 Router 1 上执行基本配置a. 将PC 连接到该路由器的控制台端口,使用终端仿真程序执行配置。

b. 在Router 1 上,按照地址表中的规定配置主机名和IP 地址,保存配置。

步骤 3:在 Router 2 上执行基本配置在Router 2 上,按照地址表中的规定配置主机名和IP 地址,保存配置。

步骤 4:在 R1 和 R2 上配置 PPP 封装在两台路由器的接口Serial 0/0 配置模式提示符后输入encapsulation ppp,将封装类型更改为PPP。

R1(config-if)#encapsulation pppR2(config-if)#encapsulation ppp步骤 5:在 R1 和 R2 上检验 PPP 封装在R1 和R2 上输入命令show interfaces serial 0/0/0,检验PPP 封装。

PPP身份验证(CHAP)的配置

PPP身份验证(CHAP)的配置

PPP 身份验证(CHAP )的配置【实验名称】PPP 身份验证(CHAP )的配置【实验目的】掌握CHAP 身份验证的配置方法【实验所模拟的环境】假设某集团公司因业务需要租用了电信运营商的专线,现需要对公司路由器与电信路由器进行链路协商,使用CHAP 方式配置身份验证,实现相互通信。

Router1为集团公司路由器,Router2为电信路由器。

【实现小结】通过CHAP 身份验证方式,协商建立链路,确保专线安全顺畅连通。

【实验拓扑】【实验设备】(1)路由器 2台(2)V.35线缆1条【IP 地址规划】分别在Router1和Router2的串口上设置IP 地址及子网掩码。

Router1 serial 1/2: IP .1Router2 serial 1/2: IP .2【实验步骤】 第一步:对路由器1进行配置Router#config terminal //进入Router1全局配置模式 Router(config)#hostname R1 //将路由器命名为R1 R1(config)#username R2 password 0 psd //建立密码数据库 R1(config)#interface serial 1/2 //配置串口s1/2 R1(config-if)#ip address //设置ip 地址及子网掩码R1(config-if)#encapsulation ppp //将端口的封装类型设置为PPP R1(config-if)#ppp authentication chap //设置CHAP 认证方式 Router2 S1/2 S1/2Router1R1(config-if)#no shutdown //激活端口第二步:对路由器2进行配置Router#config terminal //进入Router2全局配置模式Router(config)#hostname R2//将路由器命名为R2R2(config)#username R1 password 0 psd //建立用户名及密码数据库R2(config)#interface s1/2//配置串口s1/2R2(config-if)#ip address //配置ip地址及子网掩码R2(config-if)#encapsulation ppp //将端口的封装类型设置为PPP R2(config-if)#ppp authentication chap //设置CHAP认证方式R2(config-if)#clock rate 64000//为串口配置时钟频率,DCE端必须配置时钟频率,DTE端无需配置R2(config-if)#no shutdown //激活端口【验证测试】1、配置完成之后,登陆R1,输入“ping 1.1.1.2”,如出现下图所示即表示链路协商通过,配置成功2、在上一节的实验中,我们学会了使用debug命令来获取设备间是如何协商的信息。

4.2PPP的CHAP认证

4.2PPP的CHAP认证

4.2PPP的CHAP认证4.2 PPP的CHAP认证【项目情境】假设你是公司的网络管理员,公司为了满足不断增长的业务需求,申请了专线接入,当客户端路由器与ISP进行链路协商时,需要验证身份,以保证链路的安全性。

要求链路协商时以MD5密文的方式进行传输。

【项目目的】1.掌握ppp协议的封装与CHAP验证配置。

2.掌握CHAP配置的测试方法、观察和记录测试结果。

3.了解CHAP三次握手,完成验证的过程。

【相关设备】路由器两台、V.35线缆一对。

【项目拓扑】【项目任务】1.如上图搭建网络环境,并对两个路由器关闭电源,分别扩展一个同异步高速串口模块(WIC-2T)。

两个路由器之间使用V.35的同步线缆连接,RouterA的S0/1口连接的是DCE端,RouterB的S0/1口连接的是DTE端。

配置RouterA和RouterB的S0/1口地址。

在RouterA 的S0/1口上配置同步时钟为64000。

2.在两个路由器的连接专线上封装广域网协议PPP,并查看端口的显示信息,测试两个路由器之间的联连性。

3.在两个路由器的连接专线上建立PPP协议的CHAP认证,RouterA 为被验证方,RouterB为验证方(即挑战式握手验证协议,双方通过三次握手,完成验证过程),并测试两个路由器之间的联连性(以MD5密文方式进行密码传输和验证,通过则PPP的LCP 层链路建立成功,两个路由器才可互通)。

先通过show running-config来查看配置。

4.在RouterB上启用debug命令验证配置,需要把S0/1进行一次shutdown再开启,观察和感受链路的建立和认证过程。

5.最后把配置以及ping的结果截图打包,以“学号姓名”为文件名,提交作业。

6.使用锐捷设备(2、3人一组)完成上面的步骤(端口见如下拓扑图)【实验命令】1.在两个路由器的连接专线上建立PPP协议的CHAP认证RouterA(config)#username RouterB password 0 123RouterB(config)#username RouterA password 0 123RouterB(config)#interface serial 0/1RouterB(config-if)#ppp authentication chap2.在RouterB上启用debug命令RouterB#debug ppp authenticationRouterB#debug ppp negotiation3.把RouterB 的S0/1进行一次shutdown再开启,观察和感受链路的建立和认证过程。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档