日期:2019-07-17 點擊: 關鍵詞:路由器PPP認證協議詳解_炫億時代
ppp也就是點到點協議是IETF推出的點到點類型線路的數據鏈路層協議。該協議不是專有協議,可以互聯不同廠商設備,支持多協議、提供可選的身份認證服務、可以以各種方式壓縮數據、支持動態地址協商、支持多鏈路捆綁等。
密碼口令驗證協議,全稱:Password Authentication Protocol。PAP是兩次握手認證協議,在鏈路首次初始化時,被認證端首先發起認證請求,向認證端發送用戶名和密碼信息進行身份認證。密碼口令以明文發送,所以安全性較低。PAP支持單項和雙向認證,認證流程圖和單、雙向認證。
挑戰握手認證協議,全稱:Challenge Handshake Authentication Protocol。CHAP通過三次握手驗證被認證端的身份,在初始鏈路建立時完成,為了提高安全性,在鏈路建立之后周期性進行驗證。CHAP比PAP更安全,因為CHAP不在線路上發送明文,而是發送經過MD5過的隨機數序列。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
最后需注意用戶名、密碼信息與路由器的對應關系;認證端、被認證端之間的信息對應關系;認證信息大小寫敏感;修改配置后,若未生效,嘗試重啟端口。