当前位置:首页 » 《随便一记》 » 正文

简单配置PPP认证_晚风挽着浮云的博客

17 人参与  2022年04月07日 09:44  分类 : 《随便一记》  评论

点击全文阅读


PPP认证

原理概述:

       在网络日益发展的今天,人们对网络安全性的要求越来越高,而PPP协议之所以能成为广域网中应用较为广泛的协议,原因之一就是它能提供验证协议CHAP(Challenge-Handshake Authentication Protocol),挑战式握手验证协议)、PAP(Password Authentication Protocol,密码验证协议),更好地保证了网络安全性。

       PAP为两次握手验证,口令为明文,验证过程仅在链路初始建立阶段进行。当链路建立阶段结束后,用户名和密码将由验证方重复地在链路上发送给验证方,直到验证通过或者中止连接。PAP不是一种安全的验证协议,因为口令是以明文方式在链路上发送的,并且用户名和口令还会被验证方不停地在链路上反复发送,导致很容易被截获。

       CHAP是三次握手验证协议,只在网络上传输用户名,而并不传输用户密码,因此安全性要比PAP高,CHAP协议是在链路建立开始就完成的,在链路建立完成后的任何时间都可以进行再次验证。当链路建立阶段完成后,验证方发送一个“challenge”报文给被验证方;被验证方经过一次Hash算法后,给验证方返回一个值;验证方把自己经过Hash算法生成的值和被验证方返回的值进行比较。如果两者匹配,那么验证通过,否则验证不通过,连接被终止。

实验目的:

掌握配置PPP PAP认证的方法

掌握配置PPP CHAP认证的方法

理解PPP PAP认证与CHAP认证的区别

我们开始实验:

 

基础配置:

R1:

#

interface Serial2/0/0

 link-protocol ppp

 ip address 10.0.13.1 255.255.255.0

#

interface Serial2/0/1

 link-protocol ppp

#

interface GigabitEthernet0/0/0

 ip address 10.0.1.254 255.255.255.0

#

interface GigabitEthernet0/0/1

#

interface NULL0

#

ospf 1

 area 0.0.0.0

  network 10.0.1.0 0.0.0.255

  network 10.0.13.0 0.0.0.255

R2:

#

interface Serial2/0/0

 link-protocol ppp

 ip address 10.0.23.254 255.255.255.0

#

interface Serial2/0/1

 link-protocol ppp

#

interface GigabitEthernet0/0/0

 ip address 10.0.2.254 255.255.255.0

#

interface GigabitEthernet0/0/1

#

interface NULL0

#

ospf 1

 area 0.0.0.0

  network 10.0.2.0 0.0.0.255

  network 10.0.23.0 0.0.0.255

R3:

#

interface Serial2/0/0

 link-protocol ppp

 ip address 10.0.13.254 255.255.255.0

#

interface Serial2/0/1

 link-protocol ppp

 ip address 10.0.23.1 255.255.255.0

#

interface GigabitEthernet0/0/0

#

interface GigabitEthernet0/0/1

#

interface NULL0

#

ospf 1

 area 0.0.0.0

  network 10.0.13.0 0.0.0.255

  network 10.0.23.0 0.0.0.255

配置完成后,我们查看网络连通性:

 

配置PPP的PAP认证:

      现在为了提升分支机构与总部通信时的安全性,在分支网关设备R1与核心设备R3上部署PPP的PAP认证。R3作为认证路由器,R1作为被认证路由器;

      由于在华为路由器上,广域网串行接口默认链路层协议即为PPP,因此可以直接配置PPP认证。在总部设备R3上使用命令设置本端的PPP协议对对端设备的认证方式为PAP,认证采用的域名为huawei;

R3:

[R3-Serial2/0/0]ppp authentication-mode pap d

[R3-Serial2/0/0]ppp authentication-mode pap domain huawei

[R3-Serial2/0/0]dis  th

[V200R003C00]

#

interface Serial2/0/0

 link-protocol ppp

 ppp authentication-mode pap domain huawei

 ip address 10.0.13.254 255.255.255.0

接下来配置认证路由器R3的本地认证信息;

[R3]aaa

[R3-aaa]au

[R3-aaa]authentication-scheme huawei 1

                                     ^

Error:Too many parameters found at '^' position.

[R3-aaa]au

[R3-aaa]authentication-scheme huawei

Info: Create a new authentication scheme.

[R3-aaa-authen-huawei]au

[R3-aaa-authen-huawei]authentication-mode lo

[R3-aaa-authen-huawei]authentication-mode local

[R3-aaa-authen-huawei]qu

[R3-aaa]do

[R3-aaa]domain hua

[R3-aaa]domain huaweiyu

Info: Success to create a new domain.

[R3-aaa-domain-huaweiyu]au

[R3-aaa-domain-huaweiyu]authorization-scheme huawei_1

Error: The authorization scheme does not exist.

[R3-aaa-domain-huaweiyu]qu

[R3-aaa]lo

[R3-aaa]local-user

                   ^

Error:Incomplete command found at '^' position.

[R3-aaa]local-use

[R3-aaa]local-user R1@huaweiyu pa

[R3-aaa]local-user R1@huaweiyu password ci

[R3-aaa]local-user R1@huaweiyu password cipher huawei

Info: Add a new user.

[R3-aaa]local-user R1@huaweiyu se

[R3-aaa]local-user R1@huaweiyu service-type ppp

配置完成后,关闭R1和R3的相连接口一段时间后再打开,使R1和R3间的链路重新连接协商,并检查链路状态和连通性;

[R3-Serial2/0/0]sh

[R3-Serial2/0/0]un

[R3-Serial2/0/0]undo sh

[R3-Serial2/0/0]undo shutdown

 

      可以观察到,现在R1与R3间无法通信,链路物理状态正常,但是链路层协议状态不正常,这是因为此时PPP链路上的PAP认证未通过,现在仅仅配置了被认证方设备R3,还需要配置相关PAP认证参数;

 

配置完成后,再次查看链路状态并测试连通性;

  

可以观察到,现在R1和R3间链路层协议状态正常,并且可以正常通信。

测试PC1和PC2之间的连通性;

 

配置PPP的CHAP认证

我们先进行网路分析

 

配置PPP的CHAP认证:

首先删除原有的PAP认证配置,域名保持不变;

[R3-Serial2/0/0]undo pp

[R3-Serial2/0/0]undo ppp au

[R3-Serial2/0/0]undo ppp authentication-mode

[R1-Serial2/0/0]undo ppp pa

[R1-Serial2/0/0]undo ppp pap lo

[R1-Serial2/0/0]undo ppp pap local-user

删除后,在认证设备R3上配置PPP认证方式为CHAP;

配置存储在本地,对端认证的方式所使用的用户名为R1,密码为huawei。

[R3-Serial2/0/0]undo pp

[R3-Serial2/0/0]undo ppp au

[R3-Serial2/0/0]undo ppp authentication-mode

[R3-Serial2/0/0]qu

[R3]aa

[R3]aaa

[R3-aaa]lo

[R3-aaa]local-user R1 pa

[R3-aaa]local-user R1 password ci

                                  ^

Error:Incomplete command found at '^' position.

[R3-aaa]local-user R1 password ci

[R3-aaa]local-user R1 password cipher huawei

Info: Add a new user.

[R3-aaa]lo

[R3-aaa]local-user R1 se

[R3-aaa]local-user R1 service-type ppp

配置完成后,查看链路状态信息;

在R1的接口上配置CHAP认证的用户名和密码;

配置完成后,测试其联通性;

实验结束;

写的不好,还望多多包涵;

备注:如有错误,请谅解!

此文章为本人学习笔记,仅供参考!如有重复!!!请联系本人!


点击全文阅读


本文链接:http://zhangshiyu.com/post/37483.html

认证  验证  配置  
<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1