思科CCNA路由器配置——PAP与CHAP认证配置实验详解

本文实例讲述了思科CCNA路由器PAP与CHAP认证配置、分享给大家供大家参考,具体如下:

一、实验目的:掌握PAPCHAP认证配置

二、拓扑图

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

三、具体步骤配置:

(1)R1路由器配置:

Router>enable  --进入特权模式

Router#configure terminal  --进入全局配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1  --修改路由器名为R1

R1(config)#interface l0  --进入回环端口

R1(config-if)#ip address 192.168.1.254 255.255.255.0  --配置ip地址

R1(config-if)#no shutdown  --激活端口

R1(config-if)#exit  --返回上一级

R1(config)#interface s0/0/0  --进入端口

R1(config-if)#ip address 192.168.12.1 255.255.255.0  --为端口配置ip地址

R1(config-if)#clock rate 64000  --设置时钟同步速率

R1(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down

R1(config-if)#exit  --返回上一级

R1(config)#route rip  --开启rip服务

R1(config-router)#version 2  --版本2

R1(config-router)#no auto-summary  --关闭路由自动汇总

R1(config-router)#network 192.168.1.0  --添加直连网段到rip

R1(config-router)#network 192.168.12.0

R1(config-router)#exit  --返回上一级

R1(config)#username abc1 password 456  --在中心路由器R1上为远程路由器R2设置用户名和密码

R1(config)#interface s0/0/0  --进入端口

R1(config-if)#encapsulation ppp  --封装端口为ppp

R1(config-if)#ppp authentication pap  --在R1上,配置PAP 验证

R1(config-if)#ppp pap sent-username abc password 123  --在中心路由器R1上为远程路由器R2设置用户名和密码

R1(config-if)#end  --返回特权模式

%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

R1#

%SYS-5-CONFIG_I: Configured from console by console

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

(2)R2路由器配置: 

Router>enable  --进入特权模式

Router#configure terminal  --进入全局配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2  --修改路由器名为R2

R2(config)#interface l0  --进入回环端口

R2(config-if)#ip address 192.168.2.254 255.255.255.0  --配置ip地址

R2(config-if)#no shutdown  --激活端口

R2(config-if)#exit  --返回上一级

R2(config)#interface s0/0/0  --进入端口

R2(config-if)#ip address 192.168.12.2 255.255.255.0  --为端口配置ip地址

R2(config-if)#no shutdown  --激活端口

R2(config-if)#interface s0/0/1  --进入端口

R2(config-if)#ip address 192.168.24.2 255.255.255.0  --为端口配置ip地址

R2(config-if)#clock rate 64000  --设置时钟同步速率

R2(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down

R2(config-if)#exit  --返回上一级

R2(config)#route rip  --开启rip协议

R2(config-router)#version 2  --版本2

R2(config-router)#no auto-summary  --关闭路由自动汇总

R2(config-router)#network 192.168.2.0  --添加直连网段到rip

R2(config-router)#network 192.168.12.0

R2(config-router)#network 192.168.24.0

R2(config-router)#exit  --返回上一级

R2(config)#username abc password 123  --在R2上为R1设置用户名和密码

R2(config)#username R3 password cisco  --在R2上为R3设置用户名和密码(注意两端密码要相同)

R2(config)#interface s0/0/0  --进入端口

R2(config-if)#encapsulation ppp  --封装端口为PPP协议

R2(config-if)#ppp authentication pap  --配置PAP验证

R2(config-if)#ppp pap sent-username abc1 password 456  --在R2上为R1设置用户名和密码

R2(config-if)#interface s0/0/1  --进入端口

R2(config-if)#encapsulation ppp  --封装端口为ppp协议

R2(config-if)#ppp authentication chap  --配置chap验证

R2(config-if)#end  --返回特权模式

R2#

%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%SYS-5-CONFIG_I: Configured from console by console

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R2#

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up

(3)R3路由器配置:

Router>enable  --进特权模式

Router#configure terminal  --进入全局配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R3  --修改路由器名为R3

R3(config)#interface l0  --进入回环端口

R3(config-if)#ip address 192.168.3.254 255.255.255.0  --为端口配置ip地址

R3(config-if)#no shutdown  --激活端口

R3(config-if)#exit  --返回上一级

R3(config)#interface S0/0/0  --进入端口

R3(config-if)#ip address 192.168.24.1 255.255.255.0  --为端口配置ip地址

R3(config-if)#no shutdown  --激活端口

R3(config-if)#exit  --返回上一级

R3(config)#route rip  --开启rip协议

R3(config-router)#version 2  --版本2

R3(config-router)#no auto-summary  --关闭路由自动汇总

R3(config-router)#network 192.168.3.0  --添加直连网段到rip

R3(config-router)#network 192.168.24.0

R3(config-router)#exit  --返回上一级

R3(config)#username R2 password cisco  --在R3上为R2设置用户名和密码

R3(config)#interface s0/0/0  --进入端口

R3(config-if)#encapsulation ppp  --封装端口为ppp协议

R3(config-if)#ppp authentication chap  --配置chap验证

R3(config-if)#end  --返回特权模式

%LINK-5-CHANGED: Interface Loopback0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

R3#

%SYS-5-CONFIG_I: Configured from console by console

四、验证测试

1、测试是否开启ppp认证

(1)R1:

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

(2)R2:

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

(3)R3:

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

2、查看R1S0/0/0端口信息

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

如图,红色标记处表示是PPP认证

3、测试全网是否互通:

(1)R1R2

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

(2)R2R3

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

(3)R3R1

思科CCNA路由器配置——PAP与CHAP认证配置实验详解

结果:全网互通成功!!!