您现在的位置是:首页 >技术杂谈 >chap和ppp认证配置+MGRE实验网站首页技术杂谈

chap和ppp认证配置+MGRE实验

树下一少年 2024-06-14 17:17:59
简介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的环回

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

风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。