一、实验拓扑
二:实验要求
- 利用MGRE VPN实现总部与分部间的互通
三:实验思路
- 按照图示配置各设备IP地址
- 在内外网出口设备上配置静态缺省路由,实现公网互通
- 配置公共隧道tunnel与NHRP
- 配置私网路由(静态/RIP/OSPF)
- 测试全网通
先为各个设备配置合理IP地址:
配置完成后dis查看:
为R5配ip并设置环回:
接着配置缺省静态:
测试是否可以ping通:
、
R5为主认证方:
[r5]aaa
[r5-aaa]local-user huawei password cipher huawei
[r5-aaa]local-user huawei service-type ppp
[r5-aaa]quit
[r5]interface Serial 3/0/0
[r5-Serial3/0/0]ppp authentication-mode pap
R2为被认证方:
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ppp chap user huawei
[r2-Serial4/0/0]ppp chap password cipher huawei
R3与R5用HDLC封装:
R3:
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
R5:
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
R1,R2,R3构建一个MGRE环境,R1为中心站点,R1R4为点到点的GRE:
R1:
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.2.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
Jul 20 2023 16:34:38-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 network-id 100
R2:
r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 10.1.2.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source Serial 4/0/0
Jul 20 2023 21:01:06-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.0.0.1 register
R3:
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.2.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
Jul 20 2023 21:02:22-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 entry 10.1.2.1 15.1.1.1 register
GRE环境搭建
:
R1:
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 10.1.1.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.4
Jul 20 2023 21:05:05-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state.
R4:
[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1]ip address 10.1.1.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.4
[r4-Tunnel0/0/1]destination 15.1.1.1
Jul 20 2023 21:06:07-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state.
整个私有网段基于RIP全网可达:
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r1-rip-1]network 20.0.0.0
R2:
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
R3:
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
R4:
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0