首页 理论教育了解并实践PPP协议封装与认证

了解并实践PPP协议封装与认证

【摘要】:表3-1设备配置图3-17PPP认证实训设备R1762路由器2台,V.35线缆2条,配置PC 1台。本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。

任务一:PPP协议PAP认证

实训目的

通过以下案例的配置过程,理解、掌握PPP协议的封装及PAP认证的过程。如图3-17所示,各设备配置如表3-1所示。

表3-1 设备配置

图3-17 PPP认证

实训设备

R1762路由器2台,V.35线缆2条(一条DCE,一条DTE),配置PC 1台。

实训步骤

1.基本配置

Router(config)#hostname ra

Ra(config)#interface serial 1/2

Ra(config-if)#ip address 1.1.1.1 255.255.255.0

Ra(config-if)#no shutdown

Router(config)#hostname rb

Rb(config)#interface serial 1/2

Rb(config-if)#ip address 1.1.1.2 255.255.255.0

Rb(config-if)#clock rate 64000

Rb(config-if)#no shutdown

Ra#show interface serial 1/2

Serial 1/2 is DOWN ,line protocol is DOWN

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 0 bits/sec,0 packets/sec

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

0 packets input,0 bytes,0 res lack,0 no buffer,0 dropped

Received 0 broadcasts,0 runts,0 giants

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

0 packets output,0 bytes,0 underruns,0 dropped

0 output errors,0 collisions,2 interface resets

0 carrier transitions

No cable

DCD=down DSR=down DTR=down RTS=down CTS=down

Rb#show interface serial 1/2

serial 1/2 is DOWN ,line protocol is DOWN

Hardware is PQ2 SCC HDLC CONTROLLER serial

Interface address is:1.1.1.2/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 0 bits/sec,0 packets/sec

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

0 packets input,0 bytes,0 res lack,0 no buffer,0 dropped

Received 0 broadcasts,0 runts,0 giants

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

0 packets output,0 bytes,0 underruns,0 dropped

0 output errors,0 collisions,2 interface resets

0 carrier transitions

No cable

DCD=down DSR=down DTR=down RTS=down CTS=down

2.配置PPP协议PAP认证

Ra(config)#interface serial 1/2

Ra(config-if)#encapsulation ppp

接口下封装数据链路层协议PPP。

Ra(config-if)#ppp pap sent-username ra password 0 star

!PAP认证的用户名和密码。

!!!以上是被验证方的配置。

Rb(config)#username ra password 0 star

!验证方配置被验证方的用户名和密码。

Ra(config)#interface serial 1/2

Rb(config-if)#encapsulation ppp

Rb(config-if)#ppp authentication pap

!PPP启用PAP认证方式。

Ra#debug ppp authentication

!观察PAP验证过程。

注意:

(1)在DCE(RB)端要配置时钟。

(2)Debug ppp authentication在路由器物理层up,链路尚未建立的情况下打开才有信息输出。本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。

任务二:PPP协议CHAP认证

实训目的

通过图3-17所示实训案例的配置,掌握PPP协议CHAP认证的过程及配置方法。各设备配置如表3-2所示。

表3-2 设备配置

实训设备

R1762路由器2台,V.35线缆2条(一条DCE,一条DTE),配置PC 1台。

实训步骤

按图3-17实训拓扑图连接设备,其中V.35的DCE端连接路由器RB。

1.基本配置

Router(config)#hostname ra

Ra(config)#interface serial 1/2

Ra(config-if)#ip address 1.1.1.1 255.255.255.0

Ra(config-if)#no shutdown

Router(config)#hostname rb

Rb(config)#interface serial 1/2

Rb(config-if)#ip address 1.1.1.2 255.255.255.0

Rb(config-if)#clock rate 64000

Rb(config-if)#no shutdown

Ra#show interface serial 1/2

serial 1/2 is DOWN,line protocol is DOWN

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 0 bits/sec,0 packets/sec

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

0 packets input,0 bytes,0 res lack,0 no buffer,0 dropped

Received 0 broadcasts,0 runts,0 giants

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

0 packets output,0 bytes,0 underruns,0 dropped

0 output errors,0 collisions,2 interface resets

0 carrier transitions

No cable

DCD=down DSR=down DTR=down RTS=down CTS=down

Rb#show interface serial 1/2

serial 1/2 is DOWN ,line protocol is DOWN

Hardware is PQ2 SCC HDLC CONTROLLER serial

Interface address is:1.1.1.2/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 0 bits/sec,0 packets/sec

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

0 packets input,0 bytes,0 res lack,0 no buffer,0 dropped

Received 0 broadcasts,0 runts,0 giants

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

0 packets output,0 bytes,0 underruns,0 dropped

0 output errors,0 collisions,2 interface resets

0 carrier transitions

No cable

DCD=down DSR=down DTR=down RTS=down CTS=down

2.配置PPP协议CHAP认证

Ra(config)#username rb password 0 star

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

Ra(config)#interface serial 1/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

Rb(config-if)#encapsulation ppp

Ra#debug ppp authentication

!观察PAP验证过程。

Ra#show running-config

Building configuration...

Current configuration:525 bytes

version 8.51(building 50)(www.chuimin.cn)

hostname ra

username rb password 0 star

no service password-encryption

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 FastEthernet1/0

duplex auto

speed auto

interface FastEthernet1/1

duplex auto

speed auto

interface Null 0

line con 0

line aux 0

line vty 0 4

login

end

Rb#show running-config

Building configuration...

Current configuration:587 bytes

version 8.51(building 50)

hostname rb

username ra password 0 star

no service password-encryption

nterface serial 1/2

encapsulation PPP

ip address 1.1.1.2 255.255.255.0

clock rate 64000

interface serial 1/3

clock rate 64000

interface serial 2/0

clock rate 64000

interface serial 2/1

clock rate 64000

interface FastEthernet1/0

duplex auto

speed auto

interface FastEthernet1/1

duplex auto

speed auto

interface Null 0

line con 0

line aux 0

line vty 0 4

login

end

注意:

(1)在DCE(RB)端要配置时钟。

(2)Debug ppp authentication在路由器物理层up,链路尚未建立的情况下打开才有信息输出。本实验的实质是链路层协商建立的安全性,该信息出现在链路协商的过程中。

知识拓展

神州数码路由器对PPP协议的封装和验证

神州数码设备与锐捷设备对PPP协议的封装和验证的配置命令大同小异,下面通过如图3-18所示案例说明其配置方法。

图3-18 PPP协议的封装和验证

进行PAP验证,各设备IP配置如表3-3所示。

表3-3 设备IP配置

配置步骤

1.Router-A的配置

Router>enable

!进入特权模式

Router#config

!进入全局配置模式

Router_config#hostname Router-A

!修改机器名

Router-A_config#username RouterB password digitallchinaB

!设置账号密码

Router-A_config#interface s1/1

!进入接口模式

Router-A_config_s1/0#ip address 192.168.1.1 255.255.255.0!

配置IP地址

Router-A_config_s1/1#encapsulation PPP

!封装PPP协议

Router-A_config_s1/0#ppp authentication pap

!设置验证方式

Router-A_config_s1/0#ppp pap sent-username RouterA digitalchinaA

!设置发送给对方验证的账号密码

Router-A_config_s1/0#physical-layer speed 64000

!配置DCE时钟频率

Router-A_config_s1/0#no shutdown

2.Router-B的配置

Router>enable

!进入特权模式

Router#config

!进入全局配置模式

Router_config#hostname Router-B

!修改机器名

Router-B_config#username RouterA password digitalchinaA

!设置账号密码

Router-B_config#interface s1/0

!进入接口模式

Router-B_config_s1/0#ip address 192.168.1.2 255.255.255.0

!配置IP地址

Router-B_config_s1/1#encapsulation PPP

!封装PPP协议

Router-A_config_s1/0#ppp authentication pap

!设置验证方式

Router-A_config_s1/0#ppp pap sent-username RouterB digitalchinaB

!设置发送给对方验证的账号密码

Router-B_config_s1/0#no shutdown

注意:

账号密码一定要交叉对应,发送的账号密码要和对方账号数据库中的账号密码对应。

进行CHAP验证,各设备配置如表3-4所示。

表3-4 设备配置

实验步骤

1.Router-A的配置

Router>enable

!进入特权模式

Router#config

!进入全局配置模式

Router_config#hostname Router-A

!修改机器名

Router-A_config#username RouterB password digitallchina

!设置账号密码

Router-A_config#interface s1/1

!进入接口模式

Router-A_config_s1/0#ip address 192.168.1.1 255.255.255.0

!配置IP地址

Router-A_config_s1/1#encapsulation PPP

!封装PPP协议

Router-A_config_s1/0#ppp authentication chap

!设置验证方式

Router-A_config_s1/0#ppp chap hostname RouterA

!设置发送给对方验证的账号

Router-A_config_s1/0#physical-layer speed 64000

!配置DCE时钟频率

Router-A_config_s1/0#no shutdown

2.Router-B的配置

Router>enable

!进入特权模式

Router#config

!进入全局配置模式

Router_config#hostname Router-B

!修改机器名

Router-B_config#username RouterA password digitalchina

!设置账号密码

Router-B_config#interface s1/0

!进入接口模式

Router-B_config_s1/0#ip address 192.168.1.2 255.255.255.0

!配置IP地址

Router-B_config_s1/1#encapsulation PPP

!封装PPP协议

Router-A_config_s1/0#ppp authentication chap

!设置验证方式

Router-A_config_s1/0#ppp chap hostname RouterB

!设置发送给对方验证的账号

注意:双方密码一定要一致,发送的账号要和对方账号数据库中的账号对应。