HDLC and PPP

HDLC是点到点串行线路上(同步电路)的帧封装格式,和以太网的帧格式有很大区别,HDLC没有源MAC地址和目的MAC地址。cisco对HDLC进行专有化,默认是cisco采用的ciscoHDLC封装。

PPP也是点到点串行线路上(同步电路或异步电路)的一种帧封装格式但是PPP可以提供对多种网络层协议的支持。PPP支持认证,多链路捆绑,回拨,压缩等功能。

PPP经过四个过程在一个点对点链路上建立通信:

链路的建立和配置协调:通信的发起方发送LCP帧来配置和检测数据链路。

链路质量检测:在链路已经建立、协调之后,此阶段可选;

网络层协议配置协调:通信的发起方发送NCP帧以选择并配置网络层协议;

关闭链路:通信链路将一直保持到LCP或NCP帧关闭链路或发生一些外部事件。

 

实验拓扑

HDLC and PPP - 壁虎 - Me~~study house!
R1:
en
conf t
int s1/0
ip add 192.168.0.1 255.255.255.0
clock rate 64000
no shut
encapsulation PPP
 
R2
en
conf t
int s1/0
ip add 192.168.0.2 255.255.255.0
encapsulation ppp
 
此时全网互通!!!
R1:ping 192.168.0.2   能通!
下面改一下R2的封装协议
R2:
int s1/0
encapsulation hdlc
此时再到R1上ping 192.168.0.2
网络不通!!!这是由于接口两端的网络封装配置以及PPP认证必须一致,否则网络不通!!!
 
我们可以通过查看网络接口(show interface s1/0)来分析网络不通的原因。
显示串行接口的常见状态:
1.s1/0 is up,line protocol is up    //链路正常。
2.s1/0 is administratively down,line protocol is down     //没打开接口,使用no shutdown 可以打开接口。
3.s1/0 is up ,line protocol is down          // 物理层正常,链路层有问题,通常是没配置时钟,两端封装不匹配,PPP认证错误。
4.s1/0 is down ,line protocol is down        //物理层故障,通常是连线的问题。
 
根据以上配置,配置PAP认证:
R1(config)# int s1/0
R1(config-if)# encapsulation ppp
R1(config-if)# ppp pap sent-username R1 password 123456
R1(config)# int s1/0
R1(config-if)# encapsulation ppp
R1(config-if)# ppp authentication  pap 
R1(config)# username R2 password 654321
 
R2(config)# int s1/0
R2(config-if)#  encapusulation ppp
R2(config-if)# ppp pap sent-username R2 password 654321
R2(config)# int s1/0
R2(config-if)#  encapusulation ppp
R2(config-if)# ppp authentication pap
R2(config)# username R1 password 123456
 
CHAP验证:
R1(config)# username R2 password hello
R2(config)# username R1 password hello           //配置对方的用户名和密码,密码必须一致!
R1(config)# username R2 password hello
R1(config)# int  s1/0
R1(config)# encapsulation ppp
R1(config)# ppp authentication chap                   //在R1上配置封装ppp并应用chap验证
 
R2config)# int  s1/0
R2config)# encapsulation ppp
R2config)# ppp authentication chap
 
 
本章命令汇总:
HDLC and PPP - 壁虎 - Me~~study house!
 
 
 

你可能感兴趣的:(职场,休闲,帧中继)