频道栏目
首页 > 资讯 > CCNA > 正文

菜鸟学习CCNA-HDLC和PPP

11-07-14        来源:[db:作者]  
收藏   我要投稿

 菜鸟学习CCNA-HDLC和PPP
   HDLC 是点到点串行线路上(同步电路)的帧封装格式,其帧格式和以太网帧格式有很大的差别,HDLC 帧没有源MAC 地址和目的MAC 地址。注意:如果链路的两端都是Cisco 设备,使用HDLC 封装没有问题,但如果Cisco 设备与非Cisco 设备进行连接,应使用PPP 协议。HDLC 不能提供验证,缺少了对链路的安全保护。默认时,Cisco 路由器的串口是采用Cisco HDLC 封装的。如果串口的封装不是HDLC,要把封装改为HDLC 使用命“encapsulation hdlc”。
   PPP 也是串行线路上(同步电路或者异步电路)的一种帧封装格式,但是PPP 可以提供对多种网络层协议的支持。PPP 支持认证、多链路捆绑、回拨、压缩等功能。PPP 经过4 个过程在一个点到点的链路上建立通信连接。
HDLC配置网络拓扑图: 
 
具体配置:默认是使用HDLC;
R1#show int s0/0Serial0/0 is up, line protocol is down (disabled)
  Hardware is HD64570
  Internet address is 192.168.12.1/24
  MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,
  reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)  //默认使用的是HDLC
将HDLC模式改为PPP模式:
R1(config)#int s0/0
R1(config-if)#encapsulation PPP
R2(config)#int s0/0
R2(config-if)#encapsulation PPP
R1#show int s0/0
………
Encapsulation PPP, loopback not set, keepalive set (10 sec)
注意:如果R1和R2使用的封装协议不同的话,R1和R2是无法通信的这里将R1的封装模式改为:HDLC
R1#show int s0/0
Serial0/0 is up, line protocol is down (disabled) //两端封装不匹配,导致链路故障
   PAP(Password Authentication Protocol)利用2 次握手的简单方法进行认证。在PPP 链路建立完毕后,源节点不停地在链路上反复发送用户名和密码,直到验证通过。PAP的验证中,密码在链路上是以明文传输的,而且由于是源节点控制验证重试频率和次数,因此PAP 不能防范再生攻击和重复的尝试攻击。
网络拓扑图如:
 

具体配置:
R1(config)#int s0/0
R1(config-if)#encapsulation PPP //设置封装模式PPP
R1(config-if)#ppp pap sent-username R1 password 123456  //在远程路由器R1
上,配置在中心路由器上登录的用户名和密码
 
R2(config)#int s0/0
R2(config-if)#encapsulation PPP //s设置封装模式为PPP
R2(config-if)#ppp pap sent-username R1 password 123456  //在远程路由器R2
上,配置登录的用户名和密码
配置检测:
R2(config)#int s0/0
R2(config-if)#ppp authentication pap
R2(config-if)#
 
 %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
R2(config-if)#exit
R2(config)#username R1 password 123456
R2(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
 
R1(config-if)#ppp authentication pap
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
R1(config-if)#exit
R1(config)#username R2 password 654321
R1(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
 
    CHAP(Challenge Handshake Authentication Protocol)利用3 次握手周期地验证源端节点的身份。CHAP 验证过程在链路建立之后进行,而且在以后的任何时候都可以再次进行。这使得链路更为安全;CHAP 不允许连接发起方在没有收到询问消息的情况下进行验证尝试。CHAP 每次使用不同的询问消息,每个消息都是不可预测的唯一的值,CHAP 不直接传送密码,只传送一个不可预测的询问消息,以及该询问消息与密码经过MD5 加密运算后的加密值。所以CHAP 可以防止再生攻击,CHAP 的安全性比PAP 要高。
拓扑图如下:
 

R2(config-if)#int s0/0/0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#username R1 password hello//命令为对方配置用户名和密码,需要
                                          注意的方的密码要相同
R1config-if)#int s0/0/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap    //采用chap封装形式
R1(config-if)#username R2 password hello //命令为对方配置用户名和密码,需要注意的是两方的密码要相同

相关TAG标签
上一篇:ClassCastException是如何产生的(1)
下一篇:实现网页程序自动登录(java)
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站