1.实验要求
2.实验步骤
1.网络拓扑搭建及IP划分如下
2. r1和r2之间为hdlc封装
1)R1
[r1]int Serial 4/0/0
[r1-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
2)R2
[r2]int Serial 4/0/0
[r2-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
3.R2和R3之间为ppp封装,pap认证,R2为主认证方
1)R2
[r2]aaa
[r2-aaa]local-user qq privilege level 15 password cipher 123456
Info: Add a new user.
[r2]int s4/0/1
[r2-Serial4/0/1]ppp authentication-mode pap
2)R3
[r3]int s4/0/0
[r3-Serial4/0/0]ppp pap local-user qq password cipher 123456
4.R2和R4之间是ppp认证,chap认证,R2为主认证方
1)R2
[r2]aaa
[r2-aaa]local-user ww privilege level 15 password cipher 123456
Info: Add a new user.
[r2-aaa]local-user ww service-type ppp
[r2]int s3/0/0
[r2-Serial3/0/0]ppp authentication-mode chap
2)R4
[r4]int s4/0/0
[r4-Serial4/0/0]ppp chap password cipher 123456
[r4-Serial4/0/0]ppp chap user ww
5.构建MGRE环境
1)R1
[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 12.1.1.1
Dec 31 2022 20:43:05-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
2)R3
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s4/0/0
Dec 31 2022 20:46:12-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
3)R4
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add
[r4-Tunnel0/0/0]ip address 10.1.1.3 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source s4/0/0
Dec 31 2022 20:48:46-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
6.路由缺省和rip配置
1)R1
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 10.0.0.0
[r1-rip-1]network 192.168.1.0
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon
2)R3
[r3]ip route-static 0.0.0.0 0 22.1.1.2
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 10.0.0.0
[r3-rip-1]network 192.168.2.0
3)R4
[r4]ip route-static 0.0.0.0 0 32.1.1.2
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]net 10.0.0.0
[r4-rip-1]net 192.168.3.0
7.NAT地址转换
1)R1
[R1]acl 2000
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1-Serial4/0/0]nat outbound 2000
2)R2
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R3-Serial4/0/0]nat outbound 2000
3)R3
[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[R4-Serial4/0/0]nat outbound 2000
8.测试