马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
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的基础上加入了协议字段,可以区别各种网络层协议。在各个厂商的装备上有实现。
基本命令配置:
- Router(config-if)#encapsulation hdlc //封装HDLC协议
- Router(config-if)#keepalive seconds //设置HDLC keepalive的间隔时间,默认为10秒
- Router#debug hdlc events
复制代码 留意:HDLC只支持点对点连接,不支持验证,不支持IP地址协议,只工作与同步方式。
五、PPP协议
三个部门:
LCP(Link-Control Protocol,链路控制协议),用来创建、控制数据链路;
NCP(Network-Control Protocol,网络控制协议),用来支持多种网络协议;
三个过程:
链路创建阶段、认证阶段(可选)和网络协商阶段
六、PPP配置
这里接纳GNS3模拟器进行配置
1、任务
某公司总部设立在上海,分公司设立在长沙等地,分公司通过ISP专线连接到总部,要求使用PPP封装串行链路,并由总部为分部出口路由器分配IP地址。
2、拓扑图
3、代码
- R1#config t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int s0/0
- R1(config-if)#no shut
- R1(config-if)#ip add 202.202.202.201 255.255.255.252
- R1(config-if)#encapsulation ppp
- R1(config-if)#peer default ip add 202.202.202.202
复制代码- R2#config t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#int s0/0
- R2(config-if)#no shut
- R2(config-if)#encapsulation ppp
- R2(config-if)#ip add negotiated
复制代码 4、测试
- R2#ping 202.202.202.201
- Type escape sequence to abort.
- Sending 5, 100-byte ICMP Echos to 202.202.202.201, timeout is 2 seconds:
- !!!!!
- 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、代码
- R1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#username admin password 123456
- R1(config)#int s0/0
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp authentication pap
- R1(config-if)#no shut
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#int s0/0
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp pap sent-username admin password 123456
- R2(config-if)#no shut
复制代码 4、测试
- R1#ping 192.168.1.2
- Type escape sequence to abort.
- Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
- !!!!!
- Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/36 ms
- R1#show interfaces s0/0
- Serial0/0 is up, line protocol is up //物理端口与二层链路协议均处于up状态
- Hardware is M4T
- Internet address is 192.168.1.1/24
- MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
- reliability 255/255, txload 1/255, rxload 1/255
- Encapsulation PPP, LCP Open //封装了PPP协议
- Open: IPCP, CDPCP, crc 16, loopback not set
- Keepalive set (10 sec)
- Restart-Delay is 0 secs
- Last input 00:00:04, output 00:00:02, output hang never
- Last clearing of "show interface" counters 00:02:52
- Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
- Queueing strategy: weighted fair
- Output queue: 0/1000/64/0 (size/max total/threshold/drops)
- Conversations 0/1/256 (active/max active/max total)
- Reserved Conversations 0/0 (allocated/max allocated)
- Available Bandwidth 1158 kilobits/sec
- 5 minute input rate 0 bits/sec, 1 packets/sec
- 5 minute output rate 0 bits/sec, 1 packets/sec
- 44 packets input, 2457 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
- 53 packets output, 2313 bytes, 0 underruns
- 0 output errors, 0 collisions, 2 interface resets
- 0 unknown protocol drops
- 0 output buffer failures, 0 output buffers swapped out
- 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、代码
- R1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int s0/0
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp chap hostname admin
- R1(config-if)#ppp chap password 123456
- R1(config-if)#no shut
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#username admin password 123456
- R2(config)#int s0/0
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp authentication chap
- R2(config-if)#no shut
复制代码 4、第二种单向认证方法
图都一样的,这里就直接展示代码了
- R1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int s0/0
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp chap password 123456 //只发送密码即可
- R1(config-if)#no shut
- R1(config-if)#exit
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#username R1 password 123456 //建立用户认证数据库时,用户名为对方主机名
- R2(config)#int s0/0
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp authentication chap
- R2(config-if)#no shut
- R2(config-if)#exit
复制代码 由此可知,当认证方用户认证数据库中的认证用户名接纳被认证方主机名时,被认证方只需发送密码即可。
5、第三种单向认证方法
图都一样的,这里就直接展示代码了
- R1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#username R2 password 123456
- R1(config)#int s0/0
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#encapsulation ppp
- R1(config-if)#no shut
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#username R1 password 123456
- R2(config)#int s0/0
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp authentication chap
- R2(config-if)#no shut
复制代码 6、双向认证
- R1#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#username R2 password 123456 //用户数据库保存密码
- R1(config)#int s0/0
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp authentication chap
- R1(config-if)#no shut
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#username R1 password 123456 //用户数据库保存密码
- R2(config)#int s0/0
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp authentication chap
- R2(config-if)#no shut
复制代码 相信观察细致的同学就会发现第三种单向认证和双向认证的区别就在于被认证方是否有ppp authentication chap这里就跟前面PAP认证的末了一行留意有所相同,加上这行就是双向认证。
九、PPP多链路捆绑
1、任务
北京和上海的两个公司之间由于业务量增大,业务流量随之增长,所以必要提高两个公司间的带宽。这里接纳MLPPP技能以满足业务增长的需求。
2、拓扑图
3、代码
- R1#config t
- Enter configuration commands, one per line. End with CNTL/Z.
- R1(config)#int multilink 1
- R1(config-if)#ip add 192.168.1.1 255.255.255.0
- R1(config-if)#ppp multilink group 1
- R1(config-if)#exit
- R1(config)#int s0/1
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp multilink group 1
- R1(config-if)#no shut
- R1(config-if)#exit
- R1(config)#int s0/2
- R1(config-if)#encapsulation ppp
- R1(config-if)#ppp multilink group 1
- R1(config-if)#no shut
- R1(config-if)#exit
复制代码- R2#conf t
- Enter configuration commands, one per line. End with CNTL/Z.
- R2(config)#int multilink 1
- R2(config-if)#ip add 192.168.1.2 255.255.255.0
- R2(config-if)#ppp multilink group 1
- R2(config-if)#no shut
- R2(config-if)#exit
- R2(config)#int s0/1
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp multilink group 1
- R2(config-if)#no shut
- R2(config-if)#exit
- R2(config)#int s0/2
- R2(config-if)#encapsulation ppp
- R2(config-if)#ppp multilink group 1
- R2(config-if)#no shut
- R2(config-if)#exit
复制代码 4、测试
- R1#ping 192.168.1.2
- Type escape sequence to abort.
- Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
- !!!!!
- Success rate is 100 percent (5/5), round-trip min/avg/max = 24/32/48 ms
复制代码- R1#show ppp multilink
- Multilink1, bundle name is R2
- Endpoint discriminator is R2
- Bundle up for 00:02:37, total bandwidth 3088, load 1/255
- Receive buffer limit 24000 bytes, frag timeout 1000 ms
- 0/0 fragments/bytes in reassembly list
- 0 lost fragments, 5 reordered
- 0/0 discarded fragments/bytes, 0 lost received
- 0xE received sequence, 0xE sent sequence
- Member links: 2 active, 0 inactive (max not set, min not set) //链路成员有两个活跃的
- Se0/1, since 00:02:37
- Se0/2, since 00:02:16
- No inactive multilink interfaces
复制代码 看到这里对ppp协媾和chap协议另有不懂的同学可以评论区留言,也可以私信博主。如果是博主的内容有错误,也欢迎同学们积极指出,博主会积极更正。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |