实验八 PPP与广域网链路测试
一、实验目标1、 掌握PPP 的基本配置。掌握广域网链路通信质量测试方式。2、 理解PPP 协商过程,PAP/CHAP认证过程,掌握PPP 调试3、 掌握PPP Multilink的配置及测试。
一、实验目标
1、 掌握PPP 的基本配置。掌握广域网链路通信质量测试方式。
2、 理解PPP 协商过程,PAP/CHAP认证过程,掌握PPP 调试
3、 掌握PPP Multilink的配置及测试。
二、实验拓扑

三、实验内容
1、 基本信息配置
RT1
Router>enable
//进入全局模式
Router#configure terminal
//进入特权模式
Router(config)#hostname RT1
//命名主机名
RT1(config)#no ip domain lookup
//禁用域名查找
RT1(config)#line console 0
//进入console 线口
RT1(config-line)#logging synchronous
//自动换行
RT1(config-line)#no login
//配置登陆不需要认证
RT1(config-line)#privilege level 15
//配置console 为最高权限
RT1(config-line)#exec-timeout 0
,//配置超时为0
RT1(config-line)#exit
//退出线口
RT1(config)#line vty 04
//进入线口
RT1(config-line)#no login
//配置登陆不需要认证
RT1(config-line)#privilege level 15 //配置该线口为最高权限
RT1(config-line)#exit
//退出线口
RT3
Router>enable
Router#configure terminal Router(config)#hostname RT3 RT3(config)#no ip domain lookup RT3(config)#line console 0
RT3(config-line)#logging synchronous RT3(config-line)#no login
RT3(config-line)#privilege level 15 RT3(config-line)#exec-timeout 0 RT3(config-line)#exit
RT3(config)#line vty 04
RT3(config-line)#no login
RT3(config-line)#privilege level 15 RT3(config-line)#exit
2、 PPP 基本配置
RT1(config)#interface serial 0/0 //进入接口
,RT1(config-if)#clock rate 1000000
//配置DCE 端时钟频率
RT1(config-if)#encapsulation ppp
//配置数据链路层封装协议
RT1(config-if)#ip address 10.10.13.1 255.255.255.0
//配置ip 地址
RT1(config-if)#no shutdown
//打开接口
RT1(config-if)#exit
//退出接口
RT3(config)#interface serial 0/0
//进入接口
RT3(config-if)#encapsulation ppp
//配置数据链路层封装协议
RT3(config-if)#ip address 10.10.13.2 255.255.255.0
//配置ip 地址
RT3(config-if)#no shutdown
//打开接口
RT3(config-if)#exit
//退出接口
3、 RT1—RT3广域网链路通信质量测试
RT3#ping 10.10.13.1 size 46 repeat 1000
//小包测试
Type escape sequence to abort.
Sending 1000, 46-byte ICMP Echos to 10.10.13.1, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (1000/1000), round-trip min/avg/max = 4/16/64 ms 无丢包
,RT3#ping 10.10.13.1 size 8100 repeat 1000
//大包测试
Type escape sequence to abort.
Sending 1000, 8100-byte ICMP Echos to 10.10.13.1, timeout is 2 seconds: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (1000/1000), round-trip min/avg/max = 16/67/148 ms 无丢包
RT3#ping 10.10.13.1 size 1500 df-bit repeat 1000
//满MTU 测试
Type escape sequence to abort.
Sending 1000, 1500-byte ICMP Echos to 10.10.13.1, timeout is 2 seconds: Packet sent with the DF bit set
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (1000/1000), round-trip min/avg/max = 4/15/72 ms 无丢包
4、 PPP 自动获取IP 地址调试
RT1(config)#ip local pool ppp-ip-pool 10.10.1.11 10.10.1.200
//配置ip 地址池
RT1(config)#interface serial 0/0
//进入接口
RT1(config-if)#no ip address
//清除上步配置的ip 地址
RT1(config-if)#ip address 10.10.1.1 255.255.255.0
RT1(config-if)#peer default ip address pool ppp-ip-pool
//对端DTE 缺失ip 地址从此ip 地址池获取
RT1(config-if)#ppp ipcp dns 202.103.96.68
//配置DNS 服务器
RT1(config-if)#exit
//退出接口
,RT3(config)#interface serial 0/0
//进入接口
RT3(config-if)#shutdown
//关闭接口
RT3(config-if)#no ip address
//清除ip 地址,此步是为了去掉ip 地址后自动获取
RT3(config-if)#ip address negotiated
//启用ip 地址自动协商
RT3(config-if)#ppp ipcp dns request
//启用DNS 自动协商
RT3(config-if)#exit
//退出接口
5、 IPCP 获取IP 地址调试
//在RT3上打开debug ppp negotiation,然后将serial0/0打开,查看协商过程 RT3#debug ppp negotiation
//启用PPP ip地址协商
PPP protocol negotiation debugging is on
RT3#configure terminal
RT3(config)#interface serial 0/0
RT3(config-if)#no shutdown
*Mar 1 00:46:53.315: Se0/0 IPCP: I CONFNAK [ACKsent] id 2 len 16
*Mar 1 00:46:53.315: Se0/0 IPCP: Address 10.10.1.11 (0x03060A0A010B)
*Mar 1 00:46:53.315: Se0/0 IPCP: PrimaryDNS 202.103.96.68 (0x8106CA676044) *Mar 1 00:46:53.315: Se0/0 IPCP: O CONFREQ [ACKsent] id 3 len 16
*Mar 1 00:46:53.315: Se0/0 IPCP: Address 10.10.1.11 (0x03060A0A010B)
*Mar 1 00:46:53.315: Se0/0 IPCP: PrimaryDNS 202.103.96.68 (0x8106CA676044) *Mar 1 00:46:53.323: Se0/0 IPCP: I CONFACK [ACKsent] id 3 len 16
*Mar 1 00:46:53
RT3(config-if)#.323: Se0/0 IPCP: Address 10.10.1.11 (0x03060A0A010B)
*Mar 1 00:46:53.323: Se0/0 IPCP: PrimaryDNS 202.103.96.68 (0x8106CA676044)
,*Mar 1 00:46:53.323: Se0/0 IPCP: State is Open
*Mar 1 00:46:53.323: Se0/0 IPCP: Install negotiated IP interface address 10.10.1.11
*Mar 1 00:46:53.335: Se0/0 IPCP: Install route to 10.10.1.1
*Mar 1 00:46:53.351: Se0/0 IPCP: Add link info for cef entry 10.10.1.1
*Mar 1 00:46:54.255: LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
RT3#undebug all
//关闭调试
Port Statistics for unclassified packets is not turned on.
All possible debugging has been turned off
RT3#show ip interface brief
//查看端口信息
Interface IP-Address OK? Method Status
Serial0/0 10.10.1.11 YES IPCP up
6、 PPP PAP单向认证调试
本步目的:PPP PAP单向认证成功,RT1、RT3相连接口UP
(1) 认证方配置
RT1(config)#username usera password passa
//配置用户数据库
RT1(config)#interface serial 0/0
//进入接口
RT1(config-if)#no ip address
//清除ip 地址
RT1(config-if)#no peer default ip address
//关闭ip 地址自动获取
RT1(config-if)#no ppp ipcp dns
//关闭DNS 自动获取
RT1(config-if)#ip address 10.10.12.1 255.255.255.252
RT1(config-if)#ppp authentication pap
//启用PAP 认证 Protocol up
,(2) 被认证方配置
RT3(config)#interface serial 0/0
//进入接口
RT3(config-if)#shutdown
//关闭端口
RT3(config-if)#no ip address negotiated
//关闭ip 地址自动协商
RT3(config-if)#no ppp ipcp dns
//关闭DNS 自动获取
RT3(config-if)#ip address 10.10.12.2 255.255.255.252
RT3(config-if)#ppp pap sent-username usera password passa
//配置PAP 用于认证的用户名和密码
(3) PAP 单向认证调试
//在RT1上打开debug ppp authentication,将RT3的serial0/0打开,查看调试信息 RT1#debug ppp authentication
// PPP认证调试
PPP authentication debugging is on
RT3#debug ppp authentication
// PPP认证调试
PPP authentication debugging is on
RT3#configure terminal
RT3(config)#interface serial 0/0
RT3(config-if)#no shutdown
*Mar 1 01:15:51.523: LINK-3-UPDOWN: Interface Serial0/0, changed state to up *Mar 1 01:15:51.527: Se0/0 PPP: Using default call direction
*Mar 1 01:15:51.531: Se0/0 PPP: Treating connection as a dedicated line
*Mar 1 01:15:51.531: Se0/0 PPP: Session handle[E3000003] Session id[4] *Mar 1 01:15:51.535: Se0/0 PPP: Authorization required
*Mar 1 01:15:51.603: Se0/0 PPP: No authorization without authentication
,*Mar 1 01:15:51.607: Se0/0 PAP: Using hostname from interface PAP
*Mar 1 01:15:51.607: Se0/0 PAP: Using password from interface PAP
*Mar 1 01:15:51.611: Se0/0 PAP: O AUTH-REQ id 1 len 16 from "usera"
*Mar 1 01:15:51.671: Se0/0 PAP: I AUTH-ACK id 1 len 5
*Mar 1 01:15:52.675: LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
RT1#undebug all
RT3#undebug all
(4) 过程分析:
由被认证方发起,RT3将自己的用户名(usera )和密码(passa )发送给认证方RT1,RT1收到后,查用户数据库,发现数据库中有对应条目回复认证通
7、 PPP CHAP 单向认证
(1)认证方配置
RT1(config)#no username usera
//清除上步的用户数据库
RT1(config)#interface serial 0/0
//进入接口
RT1(config-if)#no ppp authentication
//关闭PPP 调试
RT1(config-if)#exit
//退出接口
RT1(config)#username usera password passa
//配置用户数据库
RT1(config)#interface serial 0/0
//进入接口
RT1(config-if)#ppp authentication chap
//启用CHAP 认证
(2)被认证方配置
RT3(config)#interface serial 0/0
//进入接口
,RT3(config-if)#shutdown
//关闭端口
RT3(config-if)#no ppp pap sent-username
//清除上步PAP 认证用户名
RT3(config-if)#ppp chap hostname usera
//配置CHAP 认证默认用户名,用于发送给主认证方的
RT3(config-if)#ppp chap password passa
//配置默认密码
(3)CHAP 单向认证调试
RT1#debug ppp authentication
//PPP认证调试
PPP authentication debugging is on
RT3#debug ppp authentication
//PPP认证调试
PPP authentication debugging is on
RT3(config)#interface serial 0/0
//进入接口
RT3(config-if)#no shutdown
//打开接口
*Mar 1 01:51:55.887: LINK-3-UPDOWN: Interface Serial0/0, changed state to up *Mar 1 01:51:55.891: Se0/0 PPP: Using default call direction
*Mar 1 01:51:55.895: Se0/0 PPP: Treating connection as a dedicated line *Mar 1 01:51:55.895: Se0/0 PPP: Session handle[B9000004] Session id[5] *Mar 1 01:51:55.899: Se0/0 PPP: Authorization required
*Mar 1 01:51:55.963: Se0/0 PPP: No authorization without authentication *Mar 1 01:51:55.975: Se0/0 CHAP: I CHALLENGE id 1 len 24 from "RT1" *Mar 1 01:51:55.983: Se0/0 CHAP: Using hostname from interface CHAP *Mar 1 01:51:55.987: Se0/0 CHAP: Using password from interface CHAP
,*Mar 1 01:51:55.987: Se0/0 CHAP: O RESPONSE id 1 len 26 from "usera"
*Mar 1 01:51:56.027: Se0/0 CHAP: I SUCCESS id 1 len 4
*Mar 1 01:51:57.031: LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
RT1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0/0 10.10.12.1 YES manual up up
RT3#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Serial0/0 10.10.12.2 YES manual up up
RT1#undebug all
RT3#undebug all
(4)、认证过程分析
由认证方发起认证,认证方RT1发送挑战信息,挑战信息包括:
01,ID ,随机数,用户名RT1
被认证方RT3收到挑战信息后,根据收到的用户名查找用户数据库,发现没有对应项,使用默认密码,RT3根据ID ,随机数,和密码用MD5算法生成hash 值,然后回复RT1, 回复信息包括:
02,ID ,HASH 值,用户名usera
RT1收到回复信息后,根据RT3发过来的用户名,查找用户数据库,根据ID ,保存的随机数,和查找到的密码,经过MD5算法生成HASH 值,与RT3发过来的HASH 值比较,相同,RT1回复认证通过
8、PPP PAP 双向认证调试
(1)RT1
RT1(config)#no username usera
//清除上不用户数据库
RT1(config)#interface serial 0/0
//进入接口
RT1(config-if)#no ppp authentication
//关闭PPP 调试