PPP配置全分析
在PPP應(yīng)用方面,我們需要重點(diǎn)掌握PPP配置的內(nèi)容。這方面的配置所涉及的內(nèi)容比較嘈雜,所以我們需要細(xì)致梳理一下其中所包含的內(nèi)容。那么希望通過(guò)本文的介紹,能夠讓大家對(duì)此有所了解。
◆PPP的應(yīng)用
PPP適用接口類型:
同步
異步(R&S的考試已經(jīng)不考了)
ISDN(R&S的考試已經(jīng)不考了)
高速串口(HSSI)
數(shù)字用戶線路(DSL)(R&S的考試不考)
◆同步串行鏈路上配置PPP
基本的PPP配置只需要配置PPP封裝就可以了,例1的配置是安照?qǐng)D1進(jìn)行配置
圖1兩臺(tái)路由器進(jìn)行PPP配置
圖1中路由器B的串口配置為DCE端,在routerB的串口上配置clock rate。
例1 路由器A的配置
- interface Serial1/0
- ip address 1.1.1.1 255.255.255.252
- encapsulation ppp
- no ip mroute-cache
- serial restart_delay 0
例2路由器B的配置
- interface Serial1/0
- ip address 1.1.1.2 255.255.255.252
- encapsulation ppp
- serial restart_delay 0
- clockrate 115200
◆PPP的CHAP和PAP認(rèn)證
所有使用PPP的接口都可以使用CHAP和PAP進(jìn)行認(rèn)證。都是利用設(shè)備的惟一主機(jī)名進(jìn)行驗(yàn)證的,工作方式如下:
第1步 建立PPP會(huì)話,router確認(rèn)LCP的認(rèn)證類型
第2步 router確認(rèn)CHAP or PAP方式,然后判斷認(rèn)證方式:
――檢查本地用戶數(shù)據(jù)庫(kù),默認(rèn)設(shè)置
――將認(rèn)證請(qǐng)求轉(zhuǎn)發(fā)給TACACS+ or RADIUS Server
第3步 認(rèn)證過(guò)程,收到認(rèn)證請(qǐng)求回應(yīng),有回應(yīng)即創(chuàng)建PPP,如果返回否定應(yīng)答,即拒絕連接請(qǐng)求。
LCP確定鏈路參數(shù)后開始執(zhí)行CHAP or PAP。PAP通過(guò)明文發(fā)送密碼,router對(duì)其進(jìn)行確認(rèn),安全性差CHAP在質(zhì)詢過(guò)程中使用MD5散列發(fā)生器產(chǎn)生一個(gè)128位的隨機(jī)數(shù),在鏈路上傳送這些散列數(shù)及其限定字符。
初始化的router send 質(zhì)詢信號(hào)到romte rouer。Reomte router 回應(yīng)下面4部分重要信息:
CHAP質(zhì)詢信號(hào)數(shù)據(jù)包類型識(shí)別號(hào),身份標(biāo)識(shí)(ID)的版本號(hào),識(shí)別質(zhì)詢信號(hào)序列號(hào)
一個(gè)隨機(jī)數(shù)
發(fā)出質(zhì)詢信號(hào)的router的hostname
Remote router received ,than search 與此username相對(duì)應(yīng)的密碼,Than身份標(biāo)識(shí),隨機(jī)數(shù)及密碼都輸入到MD5散列發(fā)生器里,產(chǎn)生一個(gè)散列數(shù)。然后隨同CHAP應(yīng)答數(shù)據(jù)包類型識(shí)別號(hào)、身份標(biāo)識(shí)及router hostname一起發(fā)送給始發(fā)router,正在初始化的router同樣使用MD5散列數(shù)發(fā)生器產(chǎn)生一個(gè)與remote router送來(lái)的散列值相等的一個(gè)散列數(shù),如果不相等則認(rèn)證失敗,鏈路關(guān)閉。
配置CHAP:
第1步 配置PPP封裝
第2步 在local router配置一個(gè)和撥入router hostname一致的username。在remote router上也加入一個(gè)與local router hostname 相同的username。分配給兩個(gè)username 的password必須一致。
第3步 在PPP接口下配置CHAP
例3的配置是安照?qǐng)D1的網(wǎng)絡(luò)拓?fù)溥M(jìn)行配置的信息
例3配置CHAP認(rèn)證
- RouterA:
- hostname routerA
- !
- username routerB password 0 cisco
- !
- ip subnet-zero
- !
- interface Serial1/0
- ip address 1.1.1.1 255.255.255.252
- encapsulation ppp
- no ip mroute-cache
- serial restart_delay 0
- ppp authentication chap
- routerB:
- hostname routerB
- !
- username routerA password 0 cisco
- !
- ip subnet-zero
- !
- interface Serial1/0
- ip address 1.1.1.2 255.255.255.252
- encapsulation ppp
- serial restart_delay 0
- clockrate 115200
- ppp authentication chap
配置PAP認(rèn)證
第1步 配置PPP
第2步 在本地router 加上remote router的hostname,在remote router上加上本地router的hostname,分配給兩個(gè)用戶的密碼必須一致。
第3步配置PAP
- Ppp authentication pap
- Ppp pap sent-username local_device_name password password
例4的配置是安照?qǐng)D1的網(wǎng)絡(luò)拓?fù)溥M(jìn)行配置的信息
例4配置PAP認(rèn)證
- RouterA:
- hostname routerA
- !
- username routerB password 0 cisco
- !
- ip subnet-zero
- !
- interface Serial1/0
- ip address 1.1.1.1 255.255.255.252
- encapsulation ppp
- no ip mroute-cache
- serial restart_delay 0
- ppp authentication pap
- ppp pap sent-username routerA password cisco
- routerB:
- hostname routerB
- !
- username routerA password 0 cisco
- !
- ip subnet-zero
- !
- interface Serial1/0
- ip address 1.1.1.2 255.255.255.252
- encapsulation ppp
- serial restart_delay 0
- clockrate 115200
- ppp authentication pap
- ppp pap sent-username routerB password cisco
注:hostname and password 區(qū)分大小寫