第六章:PPP协媾和HDLC协议配置与管理

打印 上一主题 下一主题

主题 1039|帖子 1039|积分 3117

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
目次
一、路由器概述
二、路由器的基本原理
 1、路由器数据处置惩罚的过程:
 2、度量值
3、影响路由度量值的因素
三、路由器基本配置
1、命令特点
2、常见命令模式
四、HDLC协议
五、PPP协议
六、PPP配置
1、任务
2、拓扑图
3、代码
4、测试
七、PAP认证配置
1、任务(pap单向认证)
2、拓扑图
3、代码
4、测试
八、CHAP认证配置
1、任务(第一种单向认证方法)
2、拓扑图
3、代码
4、第二种单向认证方法
5、第三种单向认证方法
6、双向认证
九、PPP多链路捆绑
1、任务
2、拓扑图
3、代码
4、测试

前五章已经将交换机学完,忘记了的同学可以去复习一下。我们从第六章开始学习路由器部门,接下来让我们一起学习一下吧!
一、路由器概述

在互联网网络中,路由器起着至关重要的作用。我们知道,互联网由很多分离但是又相互接洽的网络组成,这些分离的网络大概也是一个子网络组成,而路由器就是一种连接多个网络或网段的网络装备,它能将不同网络或网段之间的数据信息进行“翻译”,让它们能够相互读懂对方的数据。而路由器就是互联网的“枢纽”。
路由器也是一台盘算机,硬件与盘算机雷同。由处置惩罚器,内存,线卡和接口组成。如图所示:

二、路由器的基本原理

 1、路由器数据处置惩罚的过程:


 2、度量值

路由器度量值表示到达这条路由所指目的地址的代价,度量值越小,代表该路径越好。
留意:度量值只在同一种路由协议内比较才故意义,不同的路由协议之间路由度量值没有可比性,也不存在换算关系。 
3、影响路由度量值的因素

线路延迟、带宽、线路使用率、线路可信度、跳数、最大传输单位等。
三、路由器基本配置

1、命令特点


2、常见命令模式


交换机和路由器的模式大体分为四层:用户模式——>特权模式——>全局配置模式——>其他配置模式

四、HDLC协议

目前该协议有两个版本:
        ISO标准的HDLC:不包括协议字段,不能区别不同的网络层协议,因此只能应用在单一的网络情况中。没有得到实际装备的支持。
        厂商私有的HDLC:每个装备厂商在ISO HDLC的基础上加入了协议字段,可以区别各种网络层协议。在各个厂商的装备上有实现。
基本命令配置:
  1. Router(config-if)#encapsulation hdlc     //封装HDLC协议
  2. Router(config-if)#keepalive seconds      //设置HDLC keepalive的间隔时间,默认为10秒
  3. Router#debug hdlc events                 
复制代码
留意:HDLC只支持点对点连接,不支持验证,不支持IP地址协议,只工作与同步方式。
五、PPP协议

三个部门:
LCP(Link-Control Protocol,链路控制协议),用来创建、控制数据链路;
NCP(Network-Control Protocol,网络控制协议),用来支持多种网络协议;
三个过程:
链路创建阶段、认证阶段(可选)和网络协商阶段

六、PPP配置

这里接纳GNS3模拟器进行配置
1、任务

 某公司总部设立在上海,分公司设立在长沙等地,分公司通过ISP专线连接到总部,要求使用PPP封装串行链路,并由总部为分部出口路由器分配IP地址。
2、拓扑图


3、代码

  1. R1#config t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#int s0/0
  4. R1(config-if)#no shut
  5. R1(config-if)#ip add 202.202.202.201 255.255.255.252
  6. R1(config-if)#encapsulation ppp
  7. R1(config-if)#peer default ip add 202.202.202.202
复制代码
  1. R2#config t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#int s0/0
  4. R2(config-if)#no shut
  5. R2(config-if)#encapsulation ppp
  6. R2(config-if)#ip add negotiated
复制代码
4、测试

  1. R2#ping 202.202.202.201
  2. Type escape sequence to abort.
  3. Sending 5, 100-byte ICMP Echos to 202.202.202.201, timeout is 2 seconds:
  4. !!!!!
  5. Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms
复制代码
七、PAP认证配置

这里接纳GNS3模拟器进行配置
1、任务(pap单向认证)

路由器R1和R2之间的广域网链路之间通过PPP协议封装,实现认证方R1到被认证方R2的单向PAP认证。
2、拓扑图


3、代码

  1. R1#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#username admin password 123456
  4. R1(config)#int s0/0
  5. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  6. R1(config-if)#encapsulation ppp
  7. R1(config-if)#ppp authentication pap
  8. R1(config-if)#no shut
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#int s0/0
  4. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  5. R2(config-if)#encapsulation ppp
  6. R2(config-if)#ppp pap sent-username admin password 123456
  7. R2(config-if)#no shut
复制代码
4、测试

  1. R1#ping 192.168.1.2
  2. Type escape sequence to abort.
  3. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
  4. !!!!!
  5. Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/36 ms
  6. R1#show interfaces s0/0
  7. Serial0/0 is up, line protocol is up             //物理端口与二层链路协议均处于up状态
  8.   Hardware is M4T
  9.   Internet address is 192.168.1.1/24
  10.   MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
  11.      reliability 255/255, txload 1/255, rxload 1/255
  12.   Encapsulation PPP, LCP Open                    //封装了PPP协议
  13.   Open: IPCP, CDPCP, crc 16, loopback not set
  14.   Keepalive set (10 sec)
  15.   Restart-Delay is 0 secs
  16.   Last input 00:00:04, output 00:00:02, output hang never
  17.   Last clearing of "show interface" counters 00:02:52
  18.   Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  19.   Queueing strategy: weighted fair
  20.   Output queue: 0/1000/64/0 (size/max total/threshold/drops)
  21.      Conversations  0/1/256 (active/max active/max total)
  22.      Reserved Conversations 0/0 (allocated/max allocated)
  23.      Available Bandwidth 1158 kilobits/sec
  24.   5 minute input rate 0 bits/sec, 1 packets/sec
  25.   5 minute output rate 0 bits/sec, 1 packets/sec
  26.      44 packets input, 2457 bytes, 0 no buffer
  27.      Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
  28.      0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
  29.      53 packets output, 2313 bytes, 0 underruns
  30.      0 output errors, 0 collisions, 2 interface resets
  31.      0 unknown protocol drops
  32.      0 output buffer failures, 0 output buffers swapped out
  33.      2 carrier transitions     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
复制代码
留意:认证方数据库中的用户名和密码是和被认证方发送过来的用户名和密码进行匹配的,区分巨细写。被认证方不能配置ppp authentication pap,否则将会酿成双向认证。 
八、CHAP认证配置

1、任务(第一种单向认证方法)

 路由器R1和R2之间的广域网链路之间通过PPP协议封装,实现认证方R2到被认证方R1的单向CHAP认证,接纳被认证方手动配置认证用户名和密码的情势。
2、拓扑图


3、代码

  1. R1#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#int s0/0
  4. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  5. R1(config-if)#encapsulation ppp
  6. R1(config-if)#ppp chap hostname admin
  7. R1(config-if)#ppp chap password 123456
  8. R1(config-if)#no shut
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#username admin password 123456
  4. R2(config)#int s0/0
  5. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  6. R2(config-if)#encapsulation ppp
  7. R2(config-if)#ppp authentication chap
  8. R2(config-if)#no shut
复制代码
4、第二种单向认证方法

图都一样的,这里就直接展示代码了
  1. R1#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#int s0/0
  4. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  5. R1(config-if)#encapsulation ppp
  6. R1(config-if)#ppp chap password 123456       //只发送密码即可
  7. R1(config-if)#no shut
  8. R1(config-if)#exit
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#username R1 password 123456          //建立用户认证数据库时,用户名为对方主机名
  4. R2(config)#int s0/0
  5. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  6. R2(config-if)#encapsulation ppp
  7. R2(config-if)#ppp authentication chap
  8. R2(config-if)#no shut
  9. R2(config-if)#exit
复制代码
由此可知,当认证方用户认证数据库中的认证用户名接纳被认证方主机名时,被认证方只需发送密码即可。
5、第三种单向认证方法

图都一样的,这里就直接展示代码了
  1. R1#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#username R2 password 123456
  4. R1(config)#int s0/0
  5. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  6. R1(config-if)#encapsulation ppp
  7. R1(config-if)#no shut
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#username R1 password 123456
  4. R2(config)#int s0/0
  5. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  6. R2(config-if)#encapsulation ppp
  7. R2(config-if)#ppp authentication chap
  8. R2(config-if)#no shut
复制代码
6、双向认证

  1. R1#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#username R2 password 123456            //用户数据库保存密码
  4. R1(config)#int s0/0
  5. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  6. R1(config-if)#encapsulation ppp
  7. R1(config-if)#ppp authentication chap
  8. R1(config-if)#no shut
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#username R1 password 123456            //用户数据库保存密码
  4. R2(config)#int s0/0
  5. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  6. R2(config-if)#encapsulation ppp
  7. R2(config-if)#ppp authentication chap
  8. R2(config-if)#no shut
复制代码
相信观察细致的同学就会发现第三种单向认证和双向认证的区别就在于被认证方是否有ppp authentication chap这里就跟前面PAP认证的末了一行留意有所相同,加上这行就是双向认证。
九、PPP多链路捆绑

1、任务

  北京和上海的两个公司之间由于业务量增大,业务流量随之增长,所以必要提高两个公司间的带宽。这里接纳MLPPP技能以满足业务增长的需求。
2、拓扑图


3、代码

  1. R1#config t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R1(config)#int multilink 1
  4. R1(config-if)#ip add 192.168.1.1 255.255.255.0
  5. R1(config-if)#ppp multilink group 1
  6. R1(config-if)#exit
  7. R1(config)#int s0/1
  8. R1(config-if)#encapsulation ppp
  9. R1(config-if)#ppp multilink group 1
  10. R1(config-if)#no shut
  11. R1(config-if)#exit
  12. R1(config)#int s0/2
  13. R1(config-if)#encapsulation ppp
  14. R1(config-if)#ppp multilink group 1
  15. R1(config-if)#no shut
  16. R1(config-if)#exit
复制代码
  1. R2#conf t
  2. Enter configuration commands, one per line.  End with CNTL/Z.
  3. R2(config)#int multilink 1
  4. R2(config-if)#ip add 192.168.1.2 255.255.255.0
  5. R2(config-if)#ppp multilink group 1
  6. R2(config-if)#no shut
  7. R2(config-if)#exit
  8. R2(config)#int s0/1
  9. R2(config-if)#encapsulation ppp
  10. R2(config-if)#ppp multilink group 1
  11. R2(config-if)#no shut
  12. R2(config-if)#exit
  13. R2(config)#int s0/2
  14. R2(config-if)#encapsulation ppp
  15. R2(config-if)#ppp multilink group 1
  16. R2(config-if)#no shut
  17. R2(config-if)#exit
复制代码
4、测试

  1. R1#ping 192.168.1.2
  2. Type escape sequence to abort.
  3. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
  4. !!!!!
  5. Success rate is 100 percent (5/5), round-trip min/avg/max = 24/32/48 ms
复制代码
  1. R1#show ppp multilink
  2. Multilink1, bundle name is R2
  3.   Endpoint discriminator is R2
  4.   Bundle up for 00:02:37, total bandwidth 3088, load 1/255
  5.   Receive buffer limit 24000 bytes, frag timeout 1000 ms
  6.     0/0 fragments/bytes in reassembly list
  7.     0 lost fragments, 5 reordered
  8.     0/0 discarded fragments/bytes, 0 lost received
  9.     0xE received sequence, 0xE sent sequence
  10.   Member links: 2 active, 0 inactive (max not set, min not set)   //链路成员有两个活跃的
  11.     Se0/1, since 00:02:37
  12.     Se0/2, since 00:02:16
  13. No inactive multilink interfaces
复制代码
看到这里对ppp协媾和chap协议另有不懂的同学可以评论区留言,也可以私信博主。如果是博主的内容有错误,也欢迎同学们积极指出,博主会积极更正。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

卖不甜枣

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表