HDLC和PPP
HDLC和PPP
实验1:HDLC和PPP封装
1、实验目的
通过本实验,可以掌握以下技能;
串行链路上的封装概念;
HDLC封装;
PPP封装。
2、实验拓扑
3、实验步骤
(1)步骤1:在路由器R1和R2上配置IP地址,保证直连链路的连通性R1(config)#interface s1/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R2(config)#interface s1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
(2)步骤2:改变串行链路两端的接口封装为PPP封装
R1(config)#interface s1/1
R1(config-if)#encapsulation ppp
R2(config)#interface s1/0
R2(config-if)#encapsulation ppp
R1#show interfaces s1/1
Serial1/1 is up, line protocol is up (connected)
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 PPP, loopback not set, keepalive set (10 sec)
...
4、实验调试
(1)、测试R1和R2之间串行链路的连通性
R1#ping 192.168.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
实验1:PAP认证
5、实验目的
通过本实验,可以掌握PAP认证的配置方法。
6、实验拓扑
7、实验步骤
在实验1基础上继续本实验。首先配置路由器R1在路由器R2取得认证:(1)两端路由器上的串行采用PPP封装:
R1(config)#interface s1/1
R1(config-if)#encapsulation ppp
(2)在远程路由器R1上,配置在中心路由器上登录的用户名和密码:R1(config-if)#ppp pap sent-username R1 password 123456
(3)在中心路由器上的串口采用PPP封装:
R2(config)#interface s1/0
R2(config-if)#encapsulation ppp
(4)在中心路由器上,配置PAP验证:
R2(config-if)#ppp authentication pap
(5)中心路由器上为远程路由器设置用户名和密码:
R2(config-if)#username R1 password 123456
(6)在中心路由器R1上,配置PAP验证:
R1(config-if)#ppp authentication pap
(7)在中心路由器R1上为远程路由器R2设置用户名和密码:
R1(config-if)#username R2 password 654321
(8)在远程路由器R2上,配置以什么用户名和密码在远程路由器上登录:R2(config-if)#ppp pap sent-username R2 password 654321
实验3:CHAP认证
1、实验目的
通过本实验,可以掌握CHAP认证的配置方法。
2、实验拓扑
3、实验步骤
(1)使用“username 用户名password 密码”命令为对方配置用户名和密码,需要注意的事双方的密码要相同;
R1(config)#username R2 password hello
R2(config)#username R1 password hello
(2)路由器的两端串口采用PPP封装,并采用配置CHAP验证:
R1(config)#interface s1/1
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R2(config)#interface s1/0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap