chap和ppp认证配置+MGRE实验

题目要求

1.R2为ISP,其上只能配置IP地址
2.R1-R2之间为HDLC封装
3.R2-R3之间为ppp封装,pap认证,R2为主认证方
4.R2-R4之间为ppp封装,chap认证,R2为主认证方
5.R1,R2,R3构建MGRE环境,仅R1的IP地址固定
6.内网使用RIP获取路由,所有PC可以互相访问,并且可以访问R2的环回

2c9b1799ff8949d58a429f1deafdf94b.png

R1:

[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.1 24


[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip address 12.1.1.2 24
[r1-Serial4/0/0]link-protocol hdlc

[r1]ip route-static 0.0.0.0 0 12.1.1.1

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.4.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]source 12.1.1.2 
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 
[r1-Tunnel0/0/0]nhrp network-id 100

[r1]rip 100
[r1-rip-100]network 192.168.1.0
[r1-rip-100]network 192.168.4.0
[r1-rip-100]ping 192.168.2.2
  PING 192.168.2.2: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.2.2: bytes=56 Sequence=2 ttl=127 time=10 ms
    Reply from 192.168.2.2: bytes=56 Sequence=3 ttl=127 time=20 ms
    Reply from 192.168.2.2: bytes=56 Sequence=4 ttl=127 time=30 ms
    Reply from 192.168.2.2: bytes=56 Sequence=5 ttl=127 time=20 ms


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

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r1]ping 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=10 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=30 ms

R2:

[r2]int LoopBack 0
[r2-LoopBack0]ip address 2.2.2.2 24


[r2]interface Serial 4/0/1
[r2-Serial4/0/1]link-protocol hdlc 


[r2]interface Serial 4/0/0 
[r2-Serial4/0/0]ip address 23.1.1.1 24
[r2]aaa
[r2-aaa]local-user su password cipher 123
Info: Add a new user.
[r2-aaa]local-user su service-type ppp
[r2]inter s4/0/0
[r2-Serial4/0/0]ppp authentication-mode pap

[r2]aaa
[r2-aaa]local-user li password cipher 456
Info: Add a new user.
[r2-aaa]local-user li service-type ppp
[r2]interface Serial 3/0/1
[r2-Serial3/0/1]ip add 34.1.1.1 24
[r2-Serial3/0/1]ppp authentication-mode chap

R3:

[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.2.1 24

[r3-Serial4/0/0]ip address 23.1.1.2 24
[r3-Serial4/0/0]ppp pap local-user su password cipher 123
[r3-Serial4/0/0]ping 23.1.1.1   
  PING 23.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.1: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 23.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 23.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 23.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 23.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

[r3]ip route-static 0.0.0.0 0 23.1.1.1

[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]ip address 192.168.4.2 24
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.2 register 
[r3-Tunnel0/0/0]nhrp network-id 100

[r3]rip 100
[r3-rip-100]v 2
[r3-rip-100]network 192.168.4.0
[r3-rip-100]network 192.168.2.0

[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255 
[r3-acl-basic-2000]q
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r3-Serial4/0/0]q
[r3]ping 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

R4:

[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.3.1 24

[r4-Serial4/0/0]ip address 34.1.1.2 24
[r4-Serial4/0/0]ppp chap password cipher 456
[r4-Serial4/0/0]ping 34.1.1.1
  PING 34.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.1: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 34.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 34.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms

[r4]ip route-static 0.0.0.0 0 34.1.1.1

[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.4.3 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r4-Tunnel0/0/0]source Serial 4/0/0
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.2 register 
[r4-Tunnel0/0/0]nhrp network-id 100

[r4]rip 100
[r4-rip-100]v 2
[r4-rip-100]network 192.168.3.0
[r4-rip-100]network 192.168.4.0

[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255.
[r4]interface Serial 4/0/0 
[r4-Serial4/0/0]nat outbound 2000
[r4-Serial4/0/0]ping 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

树下一少年

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

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

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

打赏作者

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

抵扣说明:

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

余额充值