路由器PPP認證協(xié)議的原理!!
PPP也就是點到點協(xié)議是IETF推出的點到點類型線路的數(shù)據(jù)鏈路層協(xié)議。該協(xié)議不是專有協(xié)議,可以互聯(lián)不同廠商設備,支持多協(xié)議、提供可選的身份認證服務、可以以各種方式壓縮數(shù)據(jù)、支持動態(tài)地址協(xié)商、支持多鏈路捆綁等。
一、PAP:
密碼口令驗證協(xié)議,全稱:Password Authentication Protocol。PAP是兩次握手認證協(xié)議,在鏈路***初始化時,被認證端首先發(fā)起認證請求,向認證端發(fā)送用戶名和密碼信息進行身份認證。密碼口令以明文發(fā)送,所以安全性較低。PAP支持單項和雙向認證,認證流程圖和單、雙向認證。
二、CHAP:
挑戰(zhàn)握手認證協(xié)議,全稱:Challenge Handshake Authentication Protocol。CHAP通過三次握手驗證被認證端的身份,在初始鏈路建立時完成,為了提高安全性,在鏈路建立之后周期性進行驗證。CHAP比PAP更安全,因為CHAP不在線路上發(fā)送明文,而是發(fā)送經(jīng)過MD5過的隨機數(shù)序列。CHAP支持單向和雙向認證。
三、配置過程:
hostname R_A
interface Serial2/0
ip address 192.168.1.1 255.255.255.0
encapsulation ppp
ppp pap sent-username R_A password 0 123
clock rate 64000
R_A(config-if)#ip address 192.168.1.1 255.255.255.0
R_A(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R_B
R_B(config)#username R_A password 0 123
R_B(config)#interface s3/0
R_B(config-if)#encapsulation ppp
R_B(config-if)#ppp authentication pap
R_B(config-if)#ip address 192.168.1.2 255.255.255.0
R_B(config-if)#no shutdown
在路由器R_A上:
R_A#debug ppp authentication
PPP authentication debugging is on
Serial2/0 Using hostname from interface PAP
Serial2/0 Using password from interface PAP
Serial2/0 PAP: O AUTH-REQ id 17 len 15
Serial2/0 PAP: Phase is FORWARDING, Attempting Forward
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
在路由器R_B上:
R_B#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/4/6 ms
***需注意用戶名、密碼信息與路由器的對應關系;認證端、被認證端之間的信息對應關系;認證信息大小寫敏感;修改配置后,若未生效,嘗試重啟端口。