天天看點

PPP協定封裝

PPP協定封裝

Ppp協定時目前廣域網上應用最廣泛的協定之一,它的優點在于簡單、具備使用者驗證能力、可以解決IP配置設定等。

PPP協定封裝和PAP驗證配置

<a href="http://blog.51cto.com/attachment/201211/212502607.png" target="_blank"></a>

此配置為雙方驗證,pap也支援單向驗證。

RouterA上的配置

RouterA(config)#username RouterB_pap password passworddb  配置本地的使用者名和密碼,用于驗證對方。

RouterA(config)#inter serial 0/1/0

RouterA(config-if)#encapsulation ppp  配置接口的二層封裝協定為ppp

RouterA(config-if)#ppp authentication pap  配置ppp的驗證方式為pap

RouterA(config-if)#ppp pap sent-username RouterA_pap password passwordda 發送使用者名和密碼給對方

RouterA(config-if)#ip address 61.1.1.1 255.255.255.252

RouterA(config-if)#clock rate 64000

RouterA(config-if)#no shu

RouterB上的配置

Router(config)#username RouterA_pap password passwordda

Router(config)#inter serial 0/1/0

Router(config-if)#encapsulation ppp

Router(config-if)#ppp authentication pap

Router(config-if)#ppp pap sent-username RouterB_pap password passworddb

Router(config-if)#ip address 61.1.1.2 255.255.255.252

Router(config-if)#no shu

分别在RouterA和RouterB上使用show interface serial 檢視接口狀态。

RouterA#show interfaces serial 0/1/0

Serial0/1/0 is up, line protocol is up (connected)

  Hardware is HD64570

  Internet address is 61.1.1.1/30

  MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation PPP, loopback not set, keepalive set (10 sec)

  LCP Open

  Open: IPCP, CDPCP

---------------略----------

Router#show interfaces serial 0/1/0

  Internet address is 61.1.1.2/30

---------------------略-----------

<a href="http://blog.51cto.com/attachment/201211/212617423.png" target="_blank"></a>

可以ping通說明驗證通過了

PPP協定封裝和CHAP驗證配置

(本實驗在PT模拟器上完成的,可能與實際的配置有所不同)

<a href="http://blog.51cto.com/attachment/201211/212528930.png" target="_blank"></a>

此配置為雙相驗證,CHGAP也支援單向驗證,(RouteA和RouteB是使用者名和密碼必需一樣),

RouterA(config)#username RouterA password passwd

RouterA(config-if)#encapsulation ppp

RouterA(config-if)#ppp authentication chap

RouterB上配置

RouterB(config)#username RouterA password passwd

RouterB(config)#inter serial 0/1/0

RouterB(config-if)#encapsulation ppp

RouterB(config-if)#ppp authentication chap

RouterB(config-if)#ip add 61.1.1.2 255.255.255.252

RouterB(config-if)#no shu

使用show interface 指令顯示接口資訊,并且兩台路由器之間可以互相ping通。(RouterB上的配置必需還的用hostname将主機名改為RouterA和賬戶名一緻才能ping通彼此)

(在GNS3上配置即實際應用配置)

R1(config)#hostname RouterA  修改機器名

RouterA(config)#username RouterB password 123456 設定賬戶密碼

RouterA(config)#inter se1/0

RouterA(config-if)#ip add 192.168.1.1 255.255.255.252 配置ip位址

RouterA(config-if)#encapsulation ppp   封裝ppp協定

RouterA(config-if)#ppp authentication chap   設定認證方式

RouterA(config-if)#ppp chap hostname RouterA   設定發送給對方驗證的賬号

RouterA(config-if)#no shu 

RouterA(config-if)#exit

R2(config)#hostname RouterB

RouterB(config)#username RouterA password 123456 兩次的密碼要一緻

RouterB(config)#inter se1/0

RouterB(config-if)#ip add 192.168.1.2 255.255.255.252

RouterB(config-if)#ppp chap hostname RouterB

或者用aaa進行本地資料進行驗證

本文轉自 abc16810 51CTO部落格,原文連結:http://blog.51cto.com/abc16810/1050018

繼續閱讀