实验五 PPP协议的配置实验


一、实验目的

1、了解路由器默认路由的配置方法; 2、学会PPP协议认证的配置方法; 3、验证PPP协议的工作原理。

二、实验内容

1、搭建实验拓扑结构,配置计算机和路由器的端口的IP地址。

(1)在工作窗口上添加二个路由器和二台计算机,连接网线,设置好二台计算机的IP地址、子网掩码和网关地址,如下图所示。 提示:PC0的网关地址应设置为192.168.10.1,PC1的网关地址应配置为192.168.20.1。路由器应选用“Router-PT”类型,路由器之间的连接端口应选用Serial口,路由器之间的连接线应采用“Serial DCE”类型。 (2)按图示配置好二个二个路由器的端口IP,并用no shutdown命令启用该接口。 注:将左边那个路由器的名配置为Router1,将右边那个路由器的名配置为Router2。

图中左边那个路由器(Router1)的参考配置:

Router>enable  //进入特权模式
Router#config  //进入配置模式
Router(config)#hostname Router1  //设置路由器的名字为:Router1
Router1(config)#interface f0/0  //进入接口f0/0
Router1(config-if)#Pq  //配置IP
Router1(config-if)#no shutdown  //启用接口
Router1(config-if)#exit  //退出接口
Router1(config)#interface serial 2/0  //进入接口s2/0
Router1(config-if)#ip address 192.168.1.1 255.255.255.0  //配置IP
Router1(config-if)#no shutdown   //启用接口

图中右边那个路由器(Router1)的参考配置:

Router>enable 
Router#config
Router(config)#hostname Router2
Router2(config)#interface f0/0
Router2(config-if)#ip address 192.168.20.1 255.255.255.0
Router2(config-if)#no shutdown 
Router2(config-if)#exit
Router2(config)#interface serial 2/0
Router2(config-if)#ip address 192.168.1.2 255.255.255.0
Router2(config-if)#no shutdown

(3)在二个路由器上分别配置一条默认路由,如下所示。

查看数据链路层封装的协议:

Router1#show interface serial 2/0

2、PPP协议的认证配置

(1)在路由器Roter1上启用PPP协议

Router1(config)# interface serial 2/0
Router1(config-if)# encapsulation ppp  //封装PPP协议

(2)在路由器Roter2上启用PPP协议

Router2(config)# interface serial 2/0
Router2(config-if)# encapsulation ppp

(3)在路由器Router1上启用chap认证

Router1#config t
Router1(config)# username Router2 password cisco  //配置认证的用户名和密码
Router1(config)# interface serial 2/0
Router1(config-if)# ppp authentication chap  //配置PPP认证方式
Router1(config-if)# clock rate 128000  //配置时钟频率

(4)在路由器Router2上启用chap认证

Router2#config t
Router2(config)# username Router1 password cisco
Router2(config)# interface serial 2/0
Router2(config-if)# ppp authentication chap

注:在数据链路层启用PPP协议时,协议认证除了采用上面实验的chap认证方法外,也可采用pap认证方法

经验分享 程序员 微信小程序 职场和发展