实验8:ppp协议及PAP认证
- 格式:pdf
- 大小:118.12 KB
- 文档页数:2
PPP协议的PAP和CHAP认证实验人:实验名称:PPP协议的PAP和CHAP认证实验目的:掌握PPP协议的PAP和CHAP认证的配置方法实验原理:PAP认证:用小凡搭建如图实验环境,然后配置各路由器的S0/0端口IP和PPP封装协议,再配置PAP认证,当只配置R1PAP认证时,不能ping通对方(192.168.1.2),再配置R2的发送PAP认证信息时,即可ping通(单向);在R1和R2上,分别配置PAP认证和发送PAP认证信息,此时,即可ping通R2(192.168.1.2),即实验成功!(双向)CHAP认证:用小凡搭建如图实验环境,然后配置各路由器的S0/0端口IP和PPP封装协议,再配置CHAP认证,当只配置R1 CHAP认证时,不能ping通对方(192.168.1.2),再配置R2的发送CHAP 认证信息时,即可ping通(单向);在R1和R2上,分别配置CHAP认证和发送CHAP认证信息,此时,即可ping通R2(192.168.1.2),即实验成功(双向认证)自动协商IP地址:在R1上,配置分配IP地址(端口下,命令peer default ip address 192.168.1.100),然后在R2上,配置自动协商IP地址(在端口下,命令ip add negotiated),此时在R2可以获得192.168.1.100的IP地址,即实验成功!头部压缩:在R1和R2上,配置头部压缩功能,再ping 192.168.1.2,使其用数据流,用show compress 命令查看压缩情况,即实验成功!实验过程:PAP单向认证:⑴用小凡搭建如图实验环境,如图示:⑵在R1的S0/0上,配置IP,如图示:⑶在R2的S0/0上,配置IP,如图示:⑷此时,即可ping通192.168.1.2 如图示:⑸在R1上,配置PPP协议,如图示:⑹在R2上,配置PPP协议,如图示:⑺此时,又可ping通192.168.1.2 如图示:⑻在R1上,配置PAP认证,如图示:⑼在R2上,配置发送PAP认证信息,如图示:⑽此时,又可以ping通192.168.1.2 如图示:PAP双向认证:⒈在R1上,配置PAP认证,如图示:⒉在R2上,配置发送PAP认证信息,如图示:⒊配置完后,即可ping通192.168.1.2,即单向认证,如图示:⒋在R2上,配置PAP认证,如图示:⒌此时,不能ping 通192.168.1.2 如图示:⒍在R1上,配置发送PAP认证信息,此时,可以又ping通192.168.1.2 如图示:CHAP单向认证:Ⅰ在R1上,配置CHAP认证,如图示:Ⅱ在R2上,配置发送CHAP认证信息,如图示:Ⅲ此时,即可ping通192.168.1.2 ,即CHAP 的单向认证成功!如图示:CHAP双向认证:①在R1上,配置CHAP认证,如图示:②在R2上,配置发送CHAP认证信息,如图示:③在R2上,配置CHAP认证,如图示:④此时,不能ping通192.168.1.2 原因为没有在R1上,配置发送CHAP认证信息,如图示:⑤在R1上,配置发送CHAP认证信息,此时,可以ping通192.168.1.2 ,即配置CHAP双向认证成功!如图示:自动协商IP地址:㈠在原有的实验环境下,去掉R2上的S0/0端口的IP地址,如图示:㈡在R1上的S0/0端口下,配置分配的IP地址为192.168.1.100 如图示:㈢在R2上的S0/0 端口上,配置自动协商IP地址,如图示:㈣此时,在R2上,分配到192.168.1.100的IP地址,即实验成功,如图示:头部压缩:①在R1上,开启头部压缩功能,如图示:②在R2上,开启头部压缩功能,如图示:③此时,ping 192.168.1.100 ,使其有数据通过,用命令即可查看到压缩的情况,(命令show compress)如图示:总结:在实验中,CHAP认证的步骤:处理CHAP挑战数据包(1、将序列号放入MD5散列生成器2、将随机数放入MD5散列生成器3、用访问服务器的认证名和数据库进行比较4、将密码放入MD5散列生成器);当显示串行接口时,常见以下状态: 1、Serial0/0 is up, line protocol is up //链路正常2、Serial0/0 is administratively down, line protocol is down //没有打开该接口,执行no sh 打开即可3、Serial0/0 is up, line protocol is down //物理层正常,数据链路层有问题,通常是没有配置时钟,两端封装不匹配或PPP认证错误4、Serial0/0 is down, line protocol is down //物理层故障,通常是连线问题;PAP 不支持密码的加密,压缩,link绑定,设定最大传输单元等,CHAP 支持以上内容;PAP和CHAP验证发送的信息内容为验证路由器数据库中的用户名和密码;在CHAP中,被验证方不明确定义发送主机名来验证时,默认发送该路由器的主机名;配置PAP双向认证时,用户名和密码都可以不一样,但配置CHAP双向认证时,要保证两台路由器的密码一致;。
PPP认证实验目地:掌握PPP认证配置方法。
PPP认证分为两种,明文PAP和密文CHAP。
明文一般是单向验证,密文一般是双向验证。
实验拓扑:一、单向验证:说明:单向验证打个比方就像平时我们家里用的ADSL,中国电信就是验证方,本身存在着用户名和密码等信息。
个人用户就是被验证方,个人用户需要发送用户名和密码去验证。
在这里我们将R2的S0/0设为验证方,相当于中国电信。
R1的S0/0为被验证方,相当于个人用户。
实验步骤:R1的配置:R1>enR1#conf tR1(config)#no ip domain-loo #关闭自动查找#R1(config)#line con 0R1(config-line)#exec-t 0 0 #设置不超进#R1(config-line)#logg syn #同步路由器信息#R1(config-line)#exitR1(config)#int ser 0/0R1(config-if)#ip add 12.1.1.1 255.255.255.0R1(config-if)#no shR1(config-if)#encapsulation ppp #配置接口的封装类型为PPP#R1(config-if)#ppp pap sent-username R1 password ccnp #发送用户名和密码#R2的配置:R2>enR2#conf tR2(config)#no ip domain-looR2(config)#line con 0R2(config-line)#exec-t 0 0R2(config-line)#logg synR2(config-line)#exitR2(config)#username R1 password ccnp #设置用户名和密码,用户名为被验证方的hostname。
就是上面的R1。
#R2(config)#int ser 0/0R2(config-if)#ip add 12.1.1.2 255.255.255.0R2(config-if)#clock rate 64000R2(config-if)#no shR2(config-if)#encapsulation ppp #配置接口的封装类型为PPP#R2(config-if)#ppp authentication pap #开启PPP验证方式PAP#验证:R1(config-if)#do ping 12.1.1.2 #在R1上Ping R2,是通的# Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 4/36/84 ms R2(config)#exitR2#ping 12.1.1.1 #在R2上Ping R1,是通的#Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 12/41/92 ms R2#R1(config-if)#do sh int ser 0/0Serial0/0 is up, line protocol is upHardware is GT96K SerialInternet address is 12.1.1.1/24MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation PPP, LCP OpenOpen: IPCP, CDPCP, loopback not setKeepalive set (10 sec)CRC checking enabledLast input 00:00:42, output 00:00:00, output hang neverLast clearing of "show interface" counters 00:15:34Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fairOutput queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total)Reserved Conversations 0/0 (allocated/max allocated)Available Bandwidth 1158 kilobits/sec5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec179 packets input, 7525 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort187 packets output, 7332 bytes, 0 underruns0 output errors, 0 collisions, 1 interface resets0 output buffer failures, 0 output buffers swapped out0 carrier transitionsDCD=up DSR=up DTR=up RTS=up CTS=upR2(config)#do sh int ser 0/0Serial0/0 is up, line protocol is upHardware is GT96K SerialInternet address is 12.1.1.2/24MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255 Encapsulation PPP, LCP OpenOpen: IPCP, CDPCP, loopback not set这里可以看出Keepalive set (10 sec)CRC checking enabledLast input 00:00:38, output 00:00:03, output hang neverLast clearing of "show interface" counters 00:25:43Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: weighted fairOutput queue: 0/1000/64/0 (size/max total/threshold/drops) Conversations 0/1/256 (active/max active/max total)Reserved Conversations 0/0 (allocated/max allocated)Available Bandwidth 1158 kilobits/sec5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec219 packets input, 8452 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort212 packets output, 8965 bytes, 0 underruns0 output errors, 0 collisions, 1 interface resets0 output buffer failures, 0 output buffers swapped out0 carrier transitionsDCD=up DSR=up DTR=up RTS=up CTS=up。
PPP安全认证协议PPP安全认证协议一、安全认证介绍1、PPP的NCP可以承载多种协议的三层数据包。
2、PPP使用LCP控制多种链路的参数(建立、认证、压缩、回拨)二、PPP的认证类型1、PPP的pap认证是通过二次握手建立认证(明文不加密)2、PPP的chap挑战握手认证协议,通过三次握手建立认证(密文采用MD5加密)3、PPP的双向验证,采用的是chap的主验证风格4、PPP的加固验证,采用的是两种(pap,chap)验证同时使用三、加密算法介绍1、MD5加密类型:第五版的爆文条目。
采用的两种算法:①Hash算法②摘要算法2、MD5特点:①不可逆:通过MD5(摘要算法)计算出来数据后,不能在恢复。
②雪崩效应:一样的文件如果数据发生损坏,第二次用MD5计算,出来的结果不一样。
③冲突避免:任意两个文件都用MD5计算,计算的数(hash)值,绝不一样。
④不管你的数据大小,只要用MD5算出来的,它都是128Bit (16字节)四、PPP的验证命令(只能在串口上使用):1、pap认证(不加密)①username (名字) password (密码) :主验证方上配置用户名和密码②int s1/0 :进入串口③encapsulation ppp :封装PPP协议④ppp authentication pap :配置验证类型为pap⑤int s1/1 :进入串口(被验证方)⑥encapsulation ppp :封装PPP协议⑦ppp pap sent-username (名字) password (密码) :被验证方发送用户名、密码被验证方向主验证方发送用户名和密码必须是,主验证上配置的用户名和密码。
2、chap认证(MD5加密)①username (名字) password (密码) :主验证方上配置用户名和密码②int s1/0 :进入串口③encapsulation ppp :封装PPP协议④ppp authentication chap :配置验证类型为chap⑤int s1/0 :进入串口(被验证方)⑥encapsulation PPP :封装PPP协议⑦ppp chap hostname (名字) :被验证方发送用户名⑧ppp chap password (密码) :被验证方发送密码被验证方向主验证方发送用户名和密码必须是,主验证上配置的用户名和密码。
实验PPP PAP认证【实验名称】PPP PAP认证【实验目的】掌握PPP PAP认证的过程及配置【背景描述】你是公司的网络管理员,公司为了满足不断增长的业务需求,申请了专线接入,你的客户端路由器与ISP进行链路协商时要验证身份,配置路由器保证链路建立,并考虑其安全性。
【需求分析】在链路协商时保证安全验证。
链路协商时用户名、密码以明文的方式传输。
【实验拓扑】图9-2 实验拓扑图【预备知识】路由器基本配置知识、PPP PAP知识【实验设备】路由器(带串口)2台V.35线缆(DTE/DCE)1对【实验原理】PPP协议位于OSI七层模型的数据链路层,PPP协议按照功能划分为两个子层:LCP、NCP。
LCP主要负责链路的协商、建立、回拨、认证、数据的压缩、多链路捆绑等功能。
NCP主要负责和上层的协议进行协商,为网络层协议提供服务。
PPP的认证功能是指在建立PPP链路的过程中进行密码的验证,验证通过建立连接,验证不通过拆除链路。
PPP协议支持两种认证方式PAP和CHAP。
PAP(Password Authentication Protocol,密码验证协议)是指验证双方通过两次握手完成验证过程,它是一种用于对试图登录到点对点协议服务器上的用户进行身份验证的方法。
由被验证方主动发出验证请求,包含了验证的用户名和密码。
由验证方验证后做出回复,通过验证或验证失败。
在验证过程中用户名和密码以明文的方式在链路上传输。
【实验步骤】第一步:路由器基本配置Router(config)#hostname Router ARouter A(config)#interface serial 4/0Router A(config-if)#ip address 172.16.2.1 255.255.255.0Router A(config-if)# encapsulation pppRouter(config)#hostname Router BRouter B(config)#interface serial 4/0Router B(config-if)#ip address 172.16.2.2 255.255.255.0Router B(config-if)#encapsulation ppp第二步:配置PAP认证Router A(config)#interface serial 4/0Router A(config-if)#ppp pap sent-username RouterA password 0 123Router B(config)#username RouterA password 123Router B(config)#interface serial 4/0Router B(config-if)#ppp authentication pap第三步:验证PAP认证Router A#show interfaces serial 4/0Index(dec):1 (hex):1serial 4/0 is UP , line protocol is UPHardware is Infineon DSCC4 PEB20534 H-10 serialInterface address is: 172.16.2.1/24MTU 1500 bytes, BW 2000 KbitEncapsulation protocol is PPP, loopback not setKeepalive interval is 10 sec , setCarrier delay is 2 secRXload is 1 ,Txload is 1LCP OpenOpen: ipcpQueueing strategy: WFQ11421118 carrier transitionsV35 DCE cableDCD=up DSR=up DTR=up RTS=up CTS=up5 minutes input rate 54 bits/sec, 0 packets/sec5 minutes output rate 46 bits/sec, 0 packets/sec677 packets input, 14796 bytes, 0 no buffer, 28 droppedReceived 68 broadcasts, 0 runts, 0 giants0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort655 packets output, 11719 bytes, 0 underruns , 5 dropped0 output errors, 0 collisions, 18 interface resets使用debug ppp authentication 命令验证配置。
实验二十三:PPP 之PAP 验证PPP 提供了两种可选的身份认证方法:口令验证协议PAP(Password Authentication Protocol,PAP)和质询握手协议(Challenge Handshake Authentication Protocol,CHAP)。
如果双方协商达成一致,也可以不使用任何身份认证方法。
CHAP 认证比PAP 认证更安全,因为CHAP 不在线路上发送明文密码,而是发送经过摘要算法加工过的随机序列,也被称为"挑战字符串"。
同时,身份认证可以随时进行,包括在双方正常通信过程中。
一、实验内容1、PPP 协议封装2、PPP 之pap 验证二、实验目的1、掌握PPP 协议的封装2、掌握pap 验证的配置三、网络拓朴某公司两地的Cisco 路由器用DDN 线路连接起来,为了安全起见,要在路由器配置PPP 封装,并采用合适的验证,使得两地的网络能够安全通信。
需要为网络中所有路由器重新命名,并且路由器名称不能重复。
在当前实验中,路由器A 的名称为:RouterA;路由器B 的名称为:RouterB。
在路由器A(“RouterA”)中设置用户名及密码。
(路由器B 会向路由器A 发送用户名及密码以请求获得路由器A 的验证。
路由器A 会将接收的用户名及密码与自身创建的用户名及密码进行比对,如果用户名及密码均正确,则会“UP”路由器A 指定的串行接口。
在路由器B(“RouterB”)中设置用户名及密码。
(路由器A 会向路由器B 发送用户名及密码以请求获得路由器B 的验证。
路由器B 会将接收的用户名及密码与自身创建的用户名及密码进行比对,如果用户名及密码均正确,则会“UP”路由器B 指定的串行接口。
四、实验设备1、两台思科Cisco 3620 路由器(带一个以太网接口和一个同步Serial 串口)2、两台安装有windows 98/xp/2000 操作系统的主机3、若干交叉网线4、思科(Cisco)专用控制端口连接电缆5、思科(Cisco)串口背对背通信电缆五、实验过程(需要将相关命令写入实验报告)1、将路由器、主机根据如上图示进行连接2、设置主机的IP 地址、子网掩码和默认网关3、配置RouterA 的以太网接口Router# configure terminalRouter(config)# hostname RouterARouterA(config)# interface Ethernet 0/0RouterA(config-if)# ip address 192.168.1.1 255.255.255.0RouterA(config-if)# no shutdownRouterA(config-if)# exit4、配置RouterB 的以太网接口Router# configure terminalRouter(config)# hostname RouterBRouterA(config)# interface Ethernet 0/0RouterA(config-if)# ip address 192.168.3.1 255.255.255.0RouterA(config-if)# no shutdownRouterA(config-if)# exit5、配置RouterA 的同步串行接口RouterA# configure terminalRouterA(config)# interface serial 0/0RouterA(config-if)# ip address 192.168.2.1 255.255.255.0RouterA(config-if)# no shutdownRouterA(config-if)# exit6、配置RouterB 的同步串行接口RouterB# configure terminalRouterB(config)# interface serial 0/0RouterB(config-if)# ip address 192.168.2.2 255.255.255.0RouterB(config-if)# no shutdownRouterB(config-if)# exit7、DCE 设备端(RouterA)PPP 封装之PAP 验证设置(关键配置)RouterA# configure terminalRouterA(config)# username bbb password 222//为路由器RouterB设置用户名和密码(用户名为bbb,密码为“222”)RouterA(config)# interface serial 0/0RouterA(config-if)# encapsulation ppp //路由器RouterA启动PPP协议RouterA(config-if)# ppp authentication pap//配置PAP认证RouterA(config-if)# ppp pap sent-username aaa password 111 ////在路由器RouterA上,设置在路由器RouterB上登录的用户名和密码(用户名为aaa,密码为“111”)RouterA(config-if)# clock rate 64000RouterA(config-if)# exit8、DTE 设备端(RouterB)PPP 封装之PAP 验证设置(关键配置)RouterB# configure terminalRouterB(config)# username aaa password 111 //为路由器RouterA设置用户名和密码(用户名为aaa,密码为“111”)RouterB(config)# interface serial 0/0RouterB(config-if)# encapsulation ppp //路由器RouterA启动PPP协议RouterB(config-if)# ppp authentication pap//配置PAP认证RouterB(config-if)# ppp pap sent-username bbb password 222 //在路由器RouterB上,设置在路由器RouterA上登录的用户名和密码(用户名为bbb,密码为“222”)RouterB(config-if)# exit9、查看各路由器接口状态(所有接口必须全部UP,且配置的协议也已经UP)RouterA# show protocolsRouterB# show protocols10、配置RouterA 的RIP 简单路由协议RouterA# configure terminalRouterA(config)# router ripRouterA(config-router)# network 192.168.1.0RouterA(config-router)# network 192.168.2.0RouterA(config-router)# exit11、配置RouterB 的RIP 简单路由协议RouterB# configure terminalRouterB(config)# router ripRouterB(config-router)# network 192.168.2.0RouterB(config-router)# network 192.168.3.0RouterB(config-router)# exit六、思考问题1、pap 验证与chap 验证有何区别?2、在采用pap 验证时,用户名与密码的设置有何要求?七、实验报告要求:按学院实验报告要求完成实验报告的书写。
配置PPP单向PAP认证协议案例PPP协议是数据链路层常用的协议,学习计算机网络的初学者,可以通过配置PPP协议练习使用路由器的配置命令,学会在不同的命令模式之间切换,不断提高自己的网络操作技能。
本案例的练习的知识内容包括:1、学习思科路由器常用命令及命令模式的切换;2、学习如何PacketTracer模拟器中如何配置简单的PPP协议网络;3、学会测试配置PPP协议以后网络的运行情况,学习PPP协议的认证过程。
首先,我们复习一下以前学习的内容,出于对网络安全的考虑,各个厂家的路由器的命令模式一般有5种:第一种为用户模式:开机上电后路由器首先进入的是用户模式,提示符一般是“router>”的提示;第二种为特权模式:要从用户模式到特权模式,输入enable提示符表现为“router#”;第三种为全局模式:从特权模式切换到全局配置模式,需要在“router#”后面,输入conft (备注:该命令的全称为configterminal);此时命令行的提示符表现为“router(config)#”;第四种为端口模式:从全局配置模式切换到接口模式,需要在“router(config)#”下,输入需要配置的接口:intfacef0/1(注:f表示fastEthernet),提示符表现为“router(config-if)#”第五种为其他模式:包括从特权模式进入VLAN、从全局模式进入路由配置和线路访问接口等等,从全局模式到路由配置模式,输入:routerrip(表示配置rip协议),命令提示符为“router(config-router)#”如果从当前的模式退回,多次输入:exit,可以逐层退回到用户模式。
也可以输入:end,可以从权限高的级别退回到特权模式,end命令的使用可以方便我们运行ping命令 show命令的使用。
下图就是各个命令模式切换的示意图。
学习PPP-PAP认证协议的配置:PPP支持两种授权协议:PAP和CHAP.(PAP , Password Authentication Protocol)密码协议通过两次握手,一种建立点到点链路的简单方法。
点对点PPP协议PAP认证一、背景描述你是公司的网络管理员,公司为了满足不断增长的业务需求,申请了专线接入,你的客户端路由器与ISP 进行链路协商时要验证身份,配置路由器保证链路的建立,并考虑其安全性。
二、实验内容在两台路由器上配置PAP 或CHAP 验证协议,在链路协商时保证安全验证。
链路协商时密码以密文的方式传输,更安全。
具体包括PAP 单向认证和PAP 双向认证,以及CHAP 单向或双向认证。
三、实验拓扑1、PAP单向认证图1 PAP 单向认证2、PAP双向认证图2 PAP 双向认证四、相关知识1、PPP 协议点到点协议(point to point protocol,PPP)是IETF(inteIrnet engineering task force,因特网工程任务组)推出的点到点类型线路的数据链路层协议。
它解决了slip 中的问题,并成为正式的因特网标准。
PPP 支持在各种物理类型的点到点串行线路上传输上层协议报文。
PPP 有很多丰富的可选特性,如支持多协议、提供可选的身份认证服务、可以以各种方式压缩数据、支持动态地址协商、支持多链路捆绑等等。
这些丰富的选项增强了PPP 的功能。
同时,不论是异步拨号线路还是路由器之间的同步链路均可使用。
因此,应用十分广泛。
PPP 提供了两种可选的身份认证方法:口令验证协议PAP(password authentication protocol,PAP)和质询握手协议(challenge handshake authentication protocol,chap)。
如果双方协商达成一致,也可以不使用任何身份认证方法。
2、PAP 验证原理PAP 是一个简单的、实用的身份验证协议。
如图3 所示。
图3 PAP 认证示意图PAP 认证进程只在双方的通信链路建立初期进行。
如果认证成功,在通信过程中不再进行认证。
如果认证失败,则直接释放链路。
PAP 的弱点是用户的用户名和密码是明文发送的,有可能被协议分析软件捕获而导致安全问题。
认证协议介绍一PPP:点对点协议(PPP:Point to Point Protocol)PPP(点到点协议)是为在同等单元之间传输数据包这样的简单链路设计的链路层协议。
这种链路提供全双工操作,并按照顺序传递数据包。
设计目的主要是用来通过拨号或专线方式建立点对点连接发送数据,使其成为各种主机、网桥和路由器之间简单连接的一种共通的解决方案。
点对点协议(PPP)为在点对点连接上传输多协议数据包提供了一个标准方法。
PPP 最初设计是为两个对等节点之间的IP 流量传输提供一种封装协议。
在TCP-IP 协议集中它是一种用来同步调制连接的数据链路层协议(OSI 模式中的第二层),替代了原来非标准的第二层协议,即SLIP。
除了IP 以外PPP 还可以携带其它协议,包括DECnet和Novell的Internet 网包交换(IPX)。
(1)PPP具有动态分配IP地址的能力,允许在连接时刻协商IP地址;(2)PPP支持多种网络协议,比如TCP/IP、NetBEUI、NWLINK等;(3)PPP具有错误检测以及纠错能力,支持数据压缩;(4)PPP具有身份验证功能。
值(A=FFH,C=03H);协议域(两个字节)取0021H表示IP分组,取8021H表示网络控制数据,取C021H表示链路控制数据;帧校验域(FCS)也为两个字节,它用于对信息域的校验。
若信息域中出现7EH,则转换为(7DH,5EH)两个字符。
当信息域出现7DH时,则转换为(7DH,5DH)。
当信息流中出现ASCII码的控制字符(即小于20H),即在该字符前加入一个7DH字符。
封装:一种封装多协议数据报的方法。
PPP 封装提供了不同网络层协议同时在同一链路传输的多路复用技术。
PPP 封装精心设计,能保持对大多数常用硬件的兼容性,克服了SLIP不足之处的一种多用途、点到点协议,它提供的WAN数据链接封装服务类似于LAN所提供的封闭服务。
所以,PPP不仅仅提供帧定界,而且提供协议标识和位级完整性检查服务。
PPP协议 PAP认证一网络拓扑图二实验思路及实验目的1.配置IP地址2.配置IP ROUTE3.测试是否能通讯4.配置PPP认证5.测试是否不能通讯实验目的掌握PAP认证特点和配置过程及方法三基本步骤R1的基本步骤R1(config)#R1(config)#interface e0/0R1(config-if)#ip address 192.168.2.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#interface s1/0R1(config-if)#ip address 10.10.10.2 255.255.255.252R1(config-if)#no shutdownR1(config-if)#exitR1(config)#ip route 192.168.1.0 255.255.255.0 10.10.10.1 R1(config)#username R2 password xxxR1(config)#interface s1/0R1(config-if)#encapsulation pppR1(config-if)#ppp authentication papR1(config-if)#ppp pap sent-username R1 password xxxR2的基本配置R2(config)#R1(config)#interface e0/0R2(config-if)#ip address 192.168.1.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#interface s1/0R2(config-if)#ip address 10.10.10.1 255.255.255.252R2(config-if)#no shutdownR2(config-if)#exitR2(config)#ip route 192.168.2.0 255.255.255.0 10.10.10.2 R2(config)#username R1 password xxxR2(config)#interface s1/0R2(config-if)#encapsulation pppR2(config-if)#ppp authentication papR2(config-if)#ppp pap sent-username R2 password xxx四测试结果没有启用认证时测试结果PC1pingPC2PC2> ping 192.168.2.1084 bytes from 192.168.2.10 icmp_seq=1 ttl=62 time=32.012 ms84 bytes from 192.168.2.10 icmp_seq=2 ttl=62 time=68.010 ms84 bytes from 192.168.2.10 icmp_seq=3 ttl=62 time=40.541 ms84 bytes from 192.168.2.10 icmp_seq=4 ttl=62 time=33.527 ms84 bytes from 192.168.2.10 icmp_seq=5 ttl=62 time=63.501 msPC2pingPC1PC2> ping 192.168.1.1084 bytes from 192.168.1.10 icmp_seq=1 ttl=62 time=31.022 ms84 bytes from 192.168.1.10 icmp_seq=2 ttl=62 time=69.010 ms84 bytes from 192.168.1.10 icmp_seq=3 ttl=62 time=40.541 ms84 bytes from 192.168.1.10 icmp_seq=4 ttl=62 time=35.527 ms84 bytes from 192.168.1.10 icmp_seq=5 ttl=62 time=62.501 ms启用PPP认证测试结果PC1pingPC2PC1> ping 192.168.2.10*192.168.1.1 icmp_seq=1 ttl=255 time=22.135 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.1 icmp_seq=2 ttl=255 time=15.613 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.1 icmp_seq=3 ttl=255 time=15.626 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.1 icmp_seq=4 ttl=255 time=3.002 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.1.1 icmp_seq=5 ttl=255 time=15.626 ms (ICMP type:3, code:1, Destination host unreachable)PC2pingPC1PC2> ping 192.168.1.10*192.168.2.1 icmp_seq=1 ttl=255 time=9.507 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.2.1 icmp_seq=2 ttl=255 time=15.624 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.2.1 icmp_seq=3 ttl=255 time=2.502 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.2.1 icmp_seq=4 ttl=255 time=15.626 ms (ICMP type:3, code:1, Destination host unreachable)*192.168.2.1 icmp_seq=5 ttl=255 time=15.637 ms (ICMP type:3, code:1, Destination host unreachable)五配置信息R1 show running-configR1#show running-configBuilding configuration...Current configuration : 1568 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R1!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!username R2 password 0 xxx!!no crypto isakmp ccm!!!!interface Ethernet0/0ip address 192.168.2.1 255.255.255.0 half-duplexinterface Ethernet0/1no ip addressshutdownhalf-duplex!interface Ethernet0/2no ip addressshutdownhalf-duplex!interface Ethernet0/3no ip addressshutdownhalf-duplex!interface Serial1/0ip address 10.10.10.2 255.255.255.252 encapsulation pppserial restart-delay 0no dce-terminal-timing-enableppp authentication papppp pap sent-username R1 password 0 xxx !interface Serial1/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial1/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial1/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!no ip http serverno ip http secure-serverip classlessip route 192.168.1.0 255.255.255.0 10.10.10.1 !!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!endR2 show running-configR2#show running-configBuilding configuration...Current configuration : 1568 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msecno service password-encryption!hostname R2!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!memory-size iomem 5ip subnet-zerono ip icmp rate-limit unreachable ip tcp synwait-time 5!!ip cefno ip domain lookupno ip dhcp use vrf connected!!!!!!!!!!!!!!!username R1 password 0 xxx !!no crypto isakmp ccm!!!interface Ethernet0/0ip address 192.168.1.1 255.255.255.0 half-duplex!interface Ethernet0/1no ip addressshutdownhalf-duplex!interface Ethernet0/2no ip addressshutdownhalf-duplex!interface Ethernet0/3no ip addressshutdownhalf-duplex!interface Serial1/0ip address 10.10.10.1 255.255.255.252encapsulation pppserial restart-delay 0no dce-terminal-timing-enableppp authentication papppp pap sent-username R1 password 0 xxx !interface Serial1/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial1/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial1/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!no ip http serverno ip http secure-serverip classlessip route 192.168.2.0 255.255.255.0 10.10.10.2 !!!no cdp log mismatch duplex!!!control-plane!!!!!!!!!line con 0exec-timeout 0 0privilege level 15logging synchronousline aux 0exec-timeout 0 0privilege level 15logging synchronousline vty 0 4login!!end六实验总结本次实验中PPP配置,深入了解了PPP的相关内容,进一步熟悉路由器的各个配置命令。
PPP封装与验证配置
工作任务描述:
某公司为了顺利开展公司业务,需要公司局域网内部机器访问互联网资源,现向ISP申请DDN专线接入。
要求公司端路由器与ISP进行链路协商时要相互验证身份,配置两端路由器保证链路建立,并考虑其安全性。
网络拓扑见下图:
要求配置如下内容:
er和ISP两个路由器的基本配置。
●给两个路由器分别命名为User和ISP;
●两个路由器的Serial口和Fastethernet口配置IP地址(每个接口的具体IP地址见上图),
并打开端口;
●为DCE端路由器的Serial口配置时钟频率(Clock Rate )为128K;
●配置两路由器的静态或动态路由。
2.为User和ISP两个路由器封装PPP协议
●在User路由器的Serial接口模式下封装PPP协议;
如:User (config)#interface serial 0
User (config-if)#encapsulation ppp
●在ISP路由器的Serial接口模式下封装PPP协议;
3.验证PPP配置结果
●配置PC机中的IP、子网掩码及网关地址,用ping命令验证两PC机的网络连通性;●在User路由器的特权模式下,用debug ppp authentication命令,查看PPP验证过程(模
拟器不显示具体内容)。
●在User路由器的特权模式下,查看Serial口的封装协议信息。
4. 配置User路由器在ISP路由器上进行单向PAP认证
●在User路由器上配置,将自己(User)被对方(ISP)认证的用户名和密码经PAP认证
协议发送;
如,User (config-if)#ppp pap sent-username User password 123
注意:用户名区分大小写!
●在ISP路由器上启动PAP验证;
(如,ISP (config-if)#PPP authentication PAP)
●在ISP路由器上配置被认证的用户名(User)和密码(123);
(如,ISP (config)#username User password 123)
●验证配置。
用ping命令验证两PC机的网络连通性。
说明:配置完成后需要先关闭端口,再重新开启后验证才能生效。
5. 配置User与ISP路由器的双向PAP认证
●参照步骤4配置。
在User路由器上认证对方的用户名设置(ISP),密码为456。
●验证配置。
用ping命令验证两PC机的网络连通性。
6.删除PAP认证相关配置,配置CHAP验证,并验证测试。
●删除PAP认证配置。
(如,(config-if)#no ppp pap sent-username)
( (config-if)#no PPP authentication PAP
(config)#no username)
●参照步骤4和步骤5配置CHAP。
需要注意,CHAP要求用户名为对方路由器名,而密
码两方必须相同。