pap认证和chap认证实验

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

第一步:在r5上配置环回和s3/0/0接口地址,及pap认证(主认证)

[r5]int lo0
[r5-LoopBack0]ip add 5.5.5.5 24
[r5-LoopBack0]q
[r5]aaa
[r5-aaa]local-user a privilege level 15 password cipher 123456
[r5-aaa]local-user a service-type ppp
[r5-aaa]q
[r5]int s3/0/0
[r5-Serial3/0/0]ip add 15.1.1.2 24
[r5-Serial3/0/0]ppp authentication-mode pap 

第二步:在r1上配置接口,pap认证(被认证方)

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]q
[r1]int s4/0/0
[r1-Serial4/0/0]ppp pap local-user a password cipher 123456
[r1-Serial4/0/0]ip add 15.1.1.1 24 

第三步:在r5上配置s3/0/1接口,chap认证(主认证)

[r5]aaa
[r5-aaa]local-user b privilege level 15 password cipher 123456
[r5-aaa]local-user b service-type ppp
[r5-aaa]q
[r5]int s3/0/1
[r5-Serial3/0/1]ip add 25.1.1.2 24
[r5-Serial3/0/1]ppp authentication-mode chap 

第四步:在r2上配置接口,chap认证(被认证方)

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r2-GigabitEthernet0/0/0]int s4/0/0
[r2-Serial4/0/0]ip add 25.1.1.1 24
[r2-Serial4/0/0]ppp chap user b
[r2-Serial4/0/0]ppp chap password cipher 123456

第五步:在r5上配置s4/0/0接口,以及HDLC封装

[r5]int s4/0/0
[r5-Serial4/0/0]ip add 35.1.1.2 24
[r5-Serial4/0/0]link-protocol hdlc 

第六步:在R3上配置接口,以及HDLC封装

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r3-GigabitEthernet0/0/0]q
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.1 24
[r3-Serial4/0/0]link-protocol hdlc 

第七步:配置r5的g0/0/0和r4的接口

[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.2  24
[r4]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 45.1.1.1 24
[r4-GigabitEthernet0/0/2]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.4.1 24

第八步:做缺省路由

[r1]ip route-static 0.0.0.0 0 15.1.1.2
[r2]ip route-static 0.0.0.0 0 25.1.1.2
[r3]ip route-static 0.0.0.0 0 35.1.1.2
[r4]ip route-static 0.0.0.0 0 45.1.1.2

第九步:分别创建MGRE,并在r1上创建中心站点

[r1]interface t	
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 
[r1-Tunnel0/0/0]nhrp network-id 100
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0] ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r2-Tunnel0/0/0]source Serial 4/0/0
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register 
向r1注册,r1私有ip10.1.1.1,公有ip15.1.1.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register 
[r3-Tunnel0/0/0]nhrp network-id 100

第十步:在r1、r4上创建GRE

[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre 
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.1
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 10.1.2.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre 
[r4-Tunnel0/0/0]source 45.1.1.1
[r4-Tunnel0/0/0]destination 15.1.1.1

第十步:宣告私网基于rip全网可达

在这里插入图片描述

[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]network 10.0.0.0
[r2-rip-1]network 192.168.2.0 
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 10.0.0.0
[r3-rip-1]network 192.168.3.0
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 10.0.0.0
[r4-rip-1]network 192.168.4.0

第十一步:在r1上关闭水平分割

使得r2可以把数据给r1,r1又可以把数据给r3

[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon

第十二步:做个一对多的nat

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int g0/0/2
[r4-GigabitEthernet0/0/2]nat outbound 2000

第十三步:分别用PC机ping 5.5.5.5

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

流年ꦿ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值