Cisco HDLC,PPP

封裝
(config-if)#encapsulation < wan>
< wan>可選hdlc,ppp,frame-relay,通常系統會預設封裝hdlc
ps:設定必須和另一端的encapsulation相同,否則會出現line protocol is down
ps:使用show int 可知該interface的封裝方法

ps:
(config-if)#encapsulation ?
hdlc   Serial HDLC synchronous
ppp   Point-to-Point protocol
frame-relay   Frame Relay networks

使用hdlc
(config-if)#encapsulation hdlc
思科專屬HDLC,支援多協定,訊框多proprietary欄位
ps:標準HDLC只支援單一協定
ps:新的router連到isp可能不通,因為isp大多使用ppp,而router預設使用hdlc
ps:若對方設備並非cisco設備,則思科hdlc則無法連通

看hdlc是否封裝
#show interface < interface>
Serial0 is up, line protocol is up
Hardware is HD64570
Internet address is 175.10.1.2/24
MTU 1500 bytes, BW Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation hdlc, loopback not set, keepalive set (10 sec) //使用hdlc封裝
…以下省

…………………………………………..

使用ppp
(config-if)#encapsulation PPP
ex:設定serial0介面使用ppp,且ip為192.72.70.142/24
(config)#int serial 0
(config-if)#encapsulation PPP
(config-if)#ip address 192.72.70.142 255.255.255.0
(config-if)#no shutdown

使用ppp認證
(config-if)#ppp authentication < chap|pap>
ps:需以雙方的主機名稱新增user,且password兩邊需設相同
ex:用chap連到對方router的主機名稱,密碼為cisco
taipei(config)#username elan password cisco
taipei(config)#int se0
taipei(config-if)#ppp authentication chap
elan(config)#username taipei password cisco
elan(config)#int se0
elan(config-if)#ppp authentication chap
ps:若兩邊無法建立連線,極可能是username/password不正確
ps:
先試pap,若不行在試chap,順序可調換
(config-if)#ppp authentication pap chap

啟用ppp compression
(config-if)#compress [predictor|stac]
用軟體方式壓縮,且很耗效能
Compression有stacker(堆疊器)與predictor(預測器)

檢視連結上被丟棄的資料,並預防訊框迴路
(config-if)#ppp quality percentage
Error detection有Quality與Magic Number選項可協助

啟用mutlilink
(config-if)#ppp multilink
Cisco IOS 11.1版後支援,可提供負載平衡

PPP Callback
Cisco IOS 11.1版後支援,Cisco路由器可以作為回覆client或回覆server

ps
(config-if)#ppp ?
pap   Set PAP authentication parameters
authentication   Set PPP link authentication method

…..

#debug ppp nengotiation
兩邊開始建立連線時,會顯示PPP封包的傳輸狀態,可看ppp相互溝通的情形

#debug ppp authentication
可顯示網路中兩部路由器間所進行的chap,pap認證流程
畫面大致如下
PPP authentication debugging is onSe0 PPP: Phase is AUTHENTICATING by both
Se0 CHAP: 0 CHALLENGE id 112 len 25 from “router3”
Se0 CHAP: I CHALLENGE id 113 len 25 from “router1”
Se0 CHAP: O RESPONSE id 112 len 25 from “router3”
Se0 CHAP: I RESPONSE id 113 len 25 from “router1”
Se0 PPP: Sent CHAP LOGIN Request
Se0 PPP: Received LOGIN Response PASS

#debug ppp packet
顯示PPP的封包被傳送與接收,會顯示低階封包內儲存資料直接傳送的結果

取得介面資訊
#show interface < interface>
畫面大致如下:
Serial0 is up, line protocol is up
Hardware is HD64570
Internet address is 175.10.1.2/24
MTU 1500 bytes, BW Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation PPP, loopback not set, keepalive set (10 sec) //使用ppp封裝
LCP Open   //lcp正常
Open: IPCP, CDPCP    //ncp正常
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of show interface counters never
Queueing strategy: fifo
Output queue 0/40, 0 drops; input queue 0/75, 0 drops
5 minute input rate 1000 bits/sec, 2 packets/sec
5 minute output rate 1000 bits/sec, 2 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 input packets with dribble condition detected
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out