- 论坛徽章:
- 0
|
PPP(Point to Point Protocol)协议是在点对点链路上运行的数据链路层协议
PPP协议支持两种认证协议:
1.PAP(Password Authentication Protocol,口令认证协议)
2.CHAP(Challenge Handshake Authentication Protocol,质询握手认证协议)
PAP是两次握手认证协议,口令以明文传送,被认证方首先发起认证请求。
CHAP是三次握手认证协议,不发送口令,主认证方首先发起认证请求,安全性比PAP高
详细配置过程:
拓扑图:R1 S0/1 与 R2 s0/1口相连
.net文件如下:
autostart = false
[localhost]
[[3640]]
image = c:\Program Files\Dynamips\images\C3640-IS.BIN
confreg = 0x2102
idlepc = 0x604feb34
ram = 64
[[ROUTER R1]]
model = 3640
console = 2001
s1/0 = R2 s1/1
[[ROUTER R2]]
model = 3640
console = 2002
注:因我个人一直用的是Dynamips GUI(简单嘛),所以用GUI也可以的,3640的NM-4T模块支持4个serial接口。
一、单向验证
1:R1启动pap(R1为主验证方,R2为被验证方)
R1(config)#int s1/0
R1(config-if)#no shut
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#encapsulation ppp #修改封装协议为PPP
R1(config-if)#ppp authentication pap #认证协议为pap
R1(config-if)#exi
R1(config)#username test password test #设置验证用户名及密码
R2(config)#int s1/1
R2(config-if)#no shut
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp pap sent-username test password test #发送验证用户名及密码
2:R1启动chap(R1为主验证方,R2为被验证方)
R1(config)#int s1/0
R1(config-if)#no shut
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#encapsulation ppp #修改封装协议为PPP
R1(config-if)#ppp authentication chap #认证协议为pap
R1(config-if)#exi
R1(config)#username R2 password test # 发送被验证方用户名及密码,R2为被验证方hostname
R2(config)#int s1/1
R2(config-if)#no shut
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp chap password test #设置用户名及密码,用户名默认为hostname,用户名可更改,但必须两边一致
二、双向验证
1、R1跟R2同时启动pap
R1(config)#int s1/0
R1(config-if)#no shut
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication pap
R1(config-if)#ppp pap sent-username test password test
R1(config-if)#exi
R1(config)#username test password test
R2(config)#int s1/1
R2(config-if)#no shut
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication pap
R2(config-if)#ppp pap sent-username test password test
R2(config-if)#exi
R2(config)#username test password test
2、R1跟R2同时启动chap
R1(config)#int s1/0
R1(config-if)#no shut
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R1(config-if)#exi
R1(config)#username R2 password test # R2为对方hostname
R2(config)#int s1/1
R2(config-if)#no shut
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#exi
R2(config)#username R1 password test # R1为对方hostname
3、R1启动pap,R2启动chap
R1(config)#int s1/0
R1(config-if)#no shut
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication pap
R1(config-if)#ppp chap password test
R1(config-if)#exi
R1(config)#username test password test
R2(config)#int s1/1
R2(config-if)#no shut
R2(config-if)#ip add 1.1.1.2 255.255.255.0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#ppp pap sent-username test password test
R2(config-if)#exi
R2(config)#username R1 password test # R1为对方hostname
验证:ping
debug ppp authentication
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/27698/showart_289710.html |
|