國慶學(xué)不停,PPP認(rèn)證實(shí)驗(yàn)?zāi)懔私饬藳]
本次實(shí)驗(yàn)拓?fù)淙缦?,用的是思科的EVEng:

配置如下:
R1(config)#int s1/0?
R1(config-if)#encapsulation ppp?
R1(config-if)#ip add 12.1.1.1 255.255.255.0?
R1(config-if)#no shutdown?
R2(config)#int s1/1?
R2(config-if)#en?
R2(config-if)#encapsulation ppp?
R2(config-if)#ip add 12.1.1.2 255.255.255.0?
R2(config-if)#no shutdown?
到這里我們驗(yàn)證一下配置結(jié)果:show interfaces s1/0

(1)當(dāng)前是使用的 PPP 協(xié)議,LCP 狀態(tài)已經(jīng) open, 使用的 I*** CD***,在單向認(rèn)證,R1 為主認(rèn)證方,R2 為被認(rèn)證方。
R1(config)#username admin password cisco //設(shè)置本地認(rèn)證數(shù)據(jù)庫的用戶名和密碼?
R1(config)#int s1/0?
R1(config-if)#ppp authentication pap //在接口聲明啟用 PAP 認(rèn)證?
R1(config-if)#?
*Aug 26 06:59:22.228: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,?
changed state to down?
R1(config-if)#shutdown?
R1(config-if)#no shutdown?
接口 shutdown 再no shutdown 也不能 UPUP 現(xiàn)在接口是 down 的 因?yàn)閰f(xié)商還不夠,因?yàn)?R2 沒有出示用戶名密碼 認(rèn)證需要完成,數(shù)據(jù)鏈路層才能起來。?那我們來看一下接口狀態(tài):show ip int brief

被認(rèn)證方需要在接口出示 PAP 用戶名密碼。?
R2(config)#int s1/1?
R2(config-if)#ppp pap sent-username admin password cisco?
R1 是和我本地配置的匹配,成功即可通過,接口才能 UP UP。這時我們再來查看一下R1和R2的互聯(lián)接口的狀態(tài)。


然后我們再通過互ping來測試一下接口的連通性:

ping通了!!
(2)雙向認(rèn)證,R2 也作為主認(rèn)證方, R1 為被認(rèn)證方。?
R2(config)#username ABC password 123?
R2(config)#int s1/1?
R2(config-if)#ppp authentication pap?

使用 CHAP?
R1(config)#int s1/0?
R1(config-if)#encapsulation ppp?
R1(config-if)#ppp authentication chap?
R1(config-if)#ip add 12.1.1.1 255.255.255.0?
R1(config-if)#no shutdown?
R1(config-if)#ex?
R1(config)#username R2 password cisco?
*Aug 26 07:29:34.622: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,?
changed state to up?
R2(config)#int s1/1?
R2(config-if)#encapsulation ppp?
R2(config-if)#ip add 12.1.1.2 255.255.255.0?
R2(config-if)#no shutdown?
R1(config-if)#ex?
R2(config)#username R1 password cisco?

在讓 R2 做主認(rèn)證方?


因?yàn)槠ヅ涞氖?username R1 password cisco,R1 接口沒有配置任何參數(shù),默認(rèn)發(fā)送的是 R1,?
可以匹配到,所以能夠 ping 通。我們在接口配置用戶名密碼:


發(fā)現(xiàn)鏈路會 down,?

但是在出示密碼前,鏈路就 UPUP,使用的密碼還是全局配置的密碼,全局高于接口。?
?
太閣的祝福會遲到但不會缺席!太閣網(wǎng)絡(luò)學(xué)院祝大家雙節(jié)快樂!
