PPP的两种验证方式(PAP、CHAP) | 您所在的位置:网站首页 › pap格式怎么弄 › PPP的两种验证方式(PAP、CHAP) |
一、PPP
点到点协议(Point-to-Point Protocol,PPP)提供了一种在点到点链路上封装网络层协议信息的标准方法。PPP也定义了可扩展的链路控制协议(Link Control Protocol,LCP),使用验证协议协商在链路上传输网络层协议前验证链路的对端。 二、PPP的两种验证协议PPP支持两种验证协议:密码验证协议(Password Authentication Protocol,PAP)和挑战握手验证协议(Chanllenge Handshake Authentication Protocol,CHAP)。 三、PAPPAP提供了一种简单的方法,可以使对端(peer)使用两次握手建立身份验证,这个方法仅仅在链路初始化时使用。链路建立阶段完成后,对端不停地发送ID/Password对给验证者,一直到验证被响应或连接终止为止。 PAP不是一个健全的身份验证方法。密码在线路上时明文发送的,并且对回送、重复验证和错误攻击没有保护措施。 四、PAP简单实验 1.拓扑在R1设备的s0/0/0口开启抓包,链路类型选择ppp password选择simple选项时,密码将以明文形式保存在配置文件中,存在安全风险。建议使用cipher选项,将密码加密保存。 un t m Info: Current terminal monitor is off. sy Enter system view, return user view with Ctrl+Z. [Huawei]sys R1 [R1] [R1]int s0/0/0 [R1-Serial0/0/0]ppp authentication-mode pap [R1-Serial0/0/0]quit [R1] [R1]aaa [R1-aaa]local-user admin password cipher 123456 [R1-aaa]local-user admin service-type ppp [R1-aaa]quit注意:如果这里不重启接口,pap认证(验证)不会生效! [R1]int s0/0/0 [R1-Serial0/0/0]shutdown [R1-Serial0/0/0]undo shutdown [R1-Serial0/0/0]quit [R1] [R2]int s0/0/0 [R2-Serial0/0/0]shutdown [R2-Serial0/0/0]undo shutdown [R2-Serial0/0/0]quit [R2]![]() 观察到两次握手 CHAP使用三次握手验证,这种验证可以在链路建立初始化时进行,也可以在链路建立后的任何时间内重复进行。 在链路建立完成后,验证者向对端发送一个chanllenge信息,对端使用一个one-way-hash函数计算出的值响应这个信息。验证者使用相同的单向函数计算自己这一端对应的hash值校验响应值。如果两个值匹配,则验证通过;否则连接终止。 六、CHAP单向认证实验 1.拓扑与上述PAP实验同理(即对R1的s0/0/1接口进行抓包,链路类型选择ppp) 3.配置认证方 un t m Info: Current terminal monitor is off. sy Enter system view, return user view with Ctrl+Z. [Huawei]sys R1 [R1] [R1]int s0/0/1 [R1-Serial0/0/1]ppp authentication-mode chap [R1-Serial0/0/1]ppp chap user admin [R1-Serial0/0/1]quit [R1] [R1]aaa [R1-aaa]local-user admin password cipher 123456 [R1-aaa]local-user admin service-type ppp [R1-aaa]quit注意:如果这里不重启接口,chap认证(验证)同样不会生效!! [R1]int s0/0/1 [R1-Serial0/0/1]shutdown [R1-Serial0/0/1]undo shutdown [R1-Serial0/0/1]quit [R1] [R2]int s0/0/1 [R2-Serial0/0/1]shutdown [R2-Serial0/0/1]undo shutdown [R2-Serial0/0/1]quit [R2]观察到三次握手 同理 3.配置R1R1既作为认证方,也作为被认证方 un t m Info: Current terminal monitor is off. sy Enter system view, return user view with Ctrl+Z. [Huawei]sys R1 [R1]int s0/0/2 [R1-Serial0/0/2]ppp authentication-mode chap [R1-Serial0/0/2]ppp chap user admin [R1-Serial0/0/2]quit [R1] [R1]aaa [R1-aaa]local-user admin password cipher 123456 [R1-aaa]local-user admin service-type ppp [R1-aaa]quitR2同样既作为认证方,也作为被认证方 un t m Info: Current terminal monitor is off. sy Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2] [R2]int s0/0/2 [R2-Serial0/0/2]ppp authentication-mode chap [R2-Serial0/0/2]ppp chap user admin [R2-Serial0/0/2]quit [R2] [R2]aaa [R2-aaa]local-user admin password cipher 123456 [R2-aaa]local-user admin service-type ppp [R2-aaa]quit注意:如果这里不重启接口,chap认证(验证)不会生效!!! [R1]int s0/0/2 [R1-Serial0/0/2]shutdown [R1-Serial0/0/2]undo shutdown [R1-Serial0/0/2]quit [R1] [R2]int s0/0/2 [R2-Serial0/0/2]shutdown [R2-Serial0/0/2]undo shutdown [R2-Serial0/0/2]quit [R2]同样观察到三次握手 [1] 朱小平.网络规划设计师5天修炼[M]. 北京:中国水利水电出版社,2018. [2] 华为.Hedex Lite文档 |
CopyRight 2018-2019 实验室设备网 版权所有 |