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条)

 

【实验拓扑】

 

 

 

【实验步骤】

步骤一

基本配置:

Router(config)#hostname Ra                       //修改路由器名称为Ra

Ra(config)# interface serial 1/2                 //进入s1/2的接口模式

Ra(config-if)#ip address 1.1.1.1 255.255.255.0   //配置端口IP地址

Ra(config-if)#no shutdown                        //开启该端口

 

Red-Giant(config)#hostname Rb                    //修改路由器名称为Rb

Rb(config)# interface serial 1/2                 //进入s1/2的接口模式

Rb(config-if)#ip address 1.1.1.2 255.255.255.0   //配置端口IP地址

Rb(config-if)#clock rate 64000                   //设置时钟频率

Rb(config-if)#no shutdown                        //开启该端口

验证测试: (以Ra为例)

Ra#show interface serial 1/2                 //查看serial1/2接口配置

serial 1/2 is UP  , line protocol is UP

Hardware is PQ2 SCC HDLC CONTROLLER serial

Interface address is: 1.1.1.1/24

MTU 1500 bytes, BW 2000 Kbit

Encapsulation protocol is HDLC, loopback not set

Keepalive interval is 10 sec , set

Carrier delay is 2 sec

RXload is 1 ,Txload is 1

Queueing strategy: WFQ

5 minutes input rate 11 bits/sec, 0 packets/sec

5 minutes output rate 11 bits/sec, 0 packets/sec

33 packets input, 726 bytes, 0 no buffer

Received 33 broadcasts, 0 runts, 0 giants

input errors, 0 CRC, 0 frame, 0 overrun, 0 abort

32 packets output, 704 bytes, 0 underruns

0 output errors, 0 collisions, 6 interface resets

3 carrier transitions

V35 DTE cable

DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

步骤二

配置PPP CHAP认证:

Ra(config)#username Rb password 0 star

//以对方的主机名作为用户名,密码和对方的路由器一致

Ra(config)#interface serial 1/2               //进入S1/2接口模式

Ra(config-if)#encapsulation ppp               //接口下封装PPP协议

Ra(config-if)#ppp authentication chap         //PPP启用CHAP方式验证

Rb(config)#username Ra password 0 star

//以对方的主机名作为用户名,密码和对方的路由器一致

Rb(config)#interface serial 1/2               //进入S1/2接口模式

Rb(config-if)# encapsulation ppp              // 接口下封装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 DOWN

PPP: ppp_clear_author(), protocol = TYPE_LCP

%LINK CHANGED: Interface serial 1/2, changed state to up

PPP: serial 1/2 Send CHAP challenge id=29 to remote host

PPP: 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 Rb

PPP: serial 1/2 Send CHAP success id=29 to remote

PPP: 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,链路尚未建立的情况下打开才有信息输出,本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。

【参考配置】

Ra#show running-config                            //路由器Ra配置

Building configuration...

Current configuration : 489 bytes

version 8.32(building 53)

hostname Ra

username Rb password 0 star

interface serial 1/2

encapsulation PPP

ppp authentication chap

ip address 1.1.1.1 255.255.255.0

clock rate 64000

interface serial 1/3

clock rate 64000

interface FastEthernet 1/0

duplex auto

speed auto

interface FastEthernet 1/1

duplex auto

speed auto

interface Null 0

line con 0

line aux 0

line vty 0 4

login

End

Rb#show running-config                                //路由器Rb配置

Building configuration...

Current configuration : 444 bytes

version 8.32(building 53)

hostname Rb

username Ra password 0 star

interface serial 1/2

encapsulation PPP

ip address 1.1.1.2 255.255.255.0

interface serial 1/3

clock rate 64000

interface FastEthernet 1/0

duplex auto

speed auto

interface FastEthernet 1/1

duplex auto

speed auto

interface Null 0

line con 0

line aux 0

line vty 0 4

login

End