当前位置:   article > 正文

思科实验9.网络层:PPP协议配置_思科ppp协议

思科ppp协议

基础知识

PPP协议即点对点协议,是在点对点连接上传输多协议数据包提供了一个标准方法,是一种点到点的串行通信协议。PPP协议提供认证的功能,一种是pap另一种是chap,相对来说,pap认证方式安全性没有chap认证高,pap传输密码是明文的,经过两次握手实现,而chap不传输密码,是经过三次握手实现的。

常用命令

命令格式含义
encapsulation PPP封装指定协议
ppp authentication chap指定PPP用户认证方式
username 对方路由器名 password 对方路由器密码记录对方路由器名和密码
ppp pap sent-username 路由器名 password 密码设置向对方发送的pap认证信息

实验流程

目的

1.掌握不带PPP协议的配置
2.学会带有pap认证的PPP协议配置
3.学会带有chap认证的PPP协议配置

开始
设计拓扑
配置主机IP地址
配置路由器
设置PPP协议
验证主机连通

1.设计拓扑

在这里插入图片描述

2.配置主机IP地址

在这里插入图片描述
在这里插入图片描述

3.配置路由器

配置路由器0

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#exit
Router(config)#int Ser0/3/0
Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#clock rate 72000
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#route rip
Router(config-router)#version 2
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.3.0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

配置路由器1

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int Ser0/3/0
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int g0/0
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#route rip
Router(config-router)#version 2
Router(config-router)#network 192.168.3.0
Router(config-router)#network 192.168.2.0
Router(config-router)#end
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

这里使用主机PC0ping主机PC1

C:\>ping 192.168.2.11

Pinging 192.168.2.11 with 32 bytes of data:

Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=2ms TTL=126

Ping statistics for 192.168.2.11:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 3ms, Average = 2ms

C:\>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

这里是可以直接连通的,因为默认封装了HDLC协议

Router#show int s0/3/0
Serial0/3/0 is up, line protocol is up (connected)
  Hardware is HD64570
  Internet address is 192.168.3.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

但是HDLC协议兼容性不好

4.设置PPP协议

封装带pap认证的PPP协议
路由器0

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3/0, changed state to down

Router(config-if)#ppp pap sent-username route001 password 123456
Router(config-if)#exit
Router(config)#username route002 password 123456
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

路由器1

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3/0, changed state to up
Router(config-if)#ppp pap sent-username route002 password 123456
Router(config-if)#exit
Router(config)#username route001 password 12345
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

查看一下协议,看出已经是封装了PPP协议

Router#show int s0/3/0
Serial0/3/0 is up, line protocol is up (connected)
  Hardware is HD64570
  Internet address is 192.168.3.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, loopback not set, keepalive set (10 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

封装带chap认证的PPP协议
路由器0

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable secret 123456
Router(config)#username route002 password 123456
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#ppp authentication chap
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

路由器1

Router>enable
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#enable secret 123456
Router(config)#username route001 password 123456
Router(config)#int s0/3/0
Router(config-if)#encapsulation ppp
Router(config-if)#ppp authentication chap
Router(config-if)#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

5.验证主机连通

C:\>ping 192.168.2.11

Pinging 192.168.2.11 with 32 bytes of data:

Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126
Reply from 192.168.2.11: bytes=32 time=1ms TTL=126

Ping statistics for 192.168.2.11:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 4ms, Average = 1ms

C:\
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/609389
推荐阅读
相关标签
  

闽ICP备14008679号