一.实验概述
实验名称:MGRE实验
实验目的:
- 掌握 PPP 协议的 PAP/CHAP 认证与 HDLC 封装配置,理解不同广域网链路协议的工作机制与认证流程。
- 实现 MGRE 环境(R1 为 Hub)与 GRE 环境的部署,理解点到多点 VPN 与点到点 VPN 的区别、配置方法及应用场景。
- 基于 RIP 协议完成私有网络全网路由可达,掌握动态路由协议在 VPN 环境中的配置与防环机制。
- 验证 NAT / 地址转换的配置效果,实现私有网络主机以私有 IP 为源 IP 访问公网(R5 环回)的需求。
- 综合运用广域网协议、VPN 技术与动态路由,完成端到端的企业级网络连通性测试,提升复杂网络故障排查与调试能力。
二.实验拓扑与需求
拓扑图:
实验需求:
- R5 为 ISP,只能进行 IP 地址配置;其所有的 IP 地址均为公有 IP 地址
- R1 和 R5 之间使用 PPP 的 PAP 认证,R5 为主认证方;R2 和 R5 之间使用 PPP 的 chap 认证,R5 为主认证方;R3 和 R5 之间使用 HDLC 封装
- R1/R2/R3 构建一个 MGRE 环境,R1 为 Hub;R1/R4 之间构建一个 GRE 环境
- 整个私有网络基于 RIP 全网可达
- 所有 PC 设置私有 IP 为源 IP,可以访问 R5 环回
三.相关配置
1.配置IP
R1:
[R1]int g 0/0/0 [R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24 [R1-GigabitEthernet0/0/0]int s 4/0/0 [R1-Serial4/0/0]ip add 15.1.1.1 24R2:
[R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24 [R2-GigabitEthernet0/0/0]int s4/0/0 [R2-Serial4/0/0]ip add 25.1.1.2 24R3:
[R3]int g0/0/0 [R3-GigabitEthernet0/0/0]ip add 192.168.3.254 24 [R3-GigabitEthernet0/0/0]int s4/0/0 [R3-Serial4/0/0]ip add 35.1.1.3 24R4:
[R4]int g0/0/0 [R4-GigabitEthernet0/0/0]ip add 45.1.1.4 24 [R4-GigabitEthernet0/0/0]int g0/0/1 [R4-GigabitEthernet0/0/1]ip add 192.168.4.254 24R5:
[R5]int g0/0/0 [R5-GigabitEthernet0/0/0]ip add 45.1.1.5 24 [R5-GigabitEthernet0/0/0]int s4/0/0 [R5-Serial4/0/0]ip add 35.1.1.5 24 [R5-Serial4/0/0]int s4/0/1 [R5-Serial4/0/1]ip add 15.1.1.5 24 [R5-Serial4/0/1]int s3/0/1 [R5-Serial3/0/1]ip add 25.1.1.5 24 [R5-Serial3/0/1]int L0 [R5-LoopBack0]ip add 5.5.5.5 242.配置公网连通
R1:
[R1]ip route-st [R1]ip route-static 0.0.0.0 0 15.1.1.5R2:
[R1]ip route-st [R1]ip route-static 0.0.0.0 0 15.1.1.5R3:
[R3]ip route-st [R3]ip route-static 0.0.0.0 0 35.1.1.5R4:
[R4]ip route-st [R4]ip route-static 0.0.0.0 0 45.1.1.53.R1和R5间使用PPP的PAP验证,R5为主认证方
R5:
[R5-aaa]loc [R5-aaa]local-user laowang pas [R5-aaa]local-user laowang password cipher 12345 Info: Add a new user. [R5-aaa]loc [R5-aaa]local-user laowang service-type ppp [R5-aaa]int s4/0/1 [R5-Serial4/0/1]ppp authentication-mode papR1:
[R1]int s4/0/0 [R1-Serial4/0/0]ppp pap l [R1-Serial4/0/0]ppp pap local-user laowang pass [R1-Serial4/0/0]ppp pap local-user laowang password cipher 123454.R2与R5之间使用ppp的CHAP认证,R5为主认证方
R5:
[R5]aaa [R5-aaa]loc [R5-aaa]local-user laozhou pas [R5-aaa]local-user laozhou password cipher 12345 Info: Add a new user. [R5-aaa]local-user laozhou ser [R5-aaa]local-user laozhou service-type ppp [R5-aaa]int s3/0/1 [R5-Serial3/0/1]ppp au [R5-Serial3/0/1]ppp authentication-mode chapR2:
[R2]int s4/0/0 [R2-Serial4/0/0]ppp chap us [R2-Serial4/0/0]ppp chap user laozhou [R2-Serial4/0/0]ppp chap pass [R2-Serial4/0/0]ppp chap password cipher 123455.R3与R5之间使用HDLC封装
R3:
[R3-Serial4/0/0]link-protocol hdlcR5:
[R5-Serial4/0/0]link-protocol hdlc6.R1、R2、R3构建一个MGRE环境,R1为中心站点
(1)配置R1,R2,R3之间的隧道--MGRE VPN:
R1:
[R1]int Tunnel 0/0/0 [R1-Tunnel0/0/0]ip add 10.1.2.1 24 [R1-Tunnel0/0/0]tunnel-protocol gre p2mp [R1-Tunnel0/0/0]source 15.1.1.1R2:
[R2]int Tunnel 0/0/0 [R2-Tunnel0/0/0]ip add 10.1.2.2 24 [R2-Tunnel0/0/0]tunnel-protocol gre p2mp [R2-Tunnel0/0/0]source Serial 4/0/0R3:
[R3]int Tunnel 0/0/0 [R3-Tunnel0/0/0]ip add 10.1.2.3 24 [R3-Tunnel0/0/0]tunnel-protocol gre p2mp [R3-Tunnel0/0/0]source Serial 4/0/0(1)中心站点配置(R1):
R1:
[R1-Tunnel0/0/0] [R1-Tunnel0/0/0]nhrp net [R1-Tunnel0/0/0]nhrp network-id 100(3)分支站点配置:
R2:
[R2-Tunnel0/0/0]nhrp network-id 100 [R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 registerR3:
[R3-Tunnel0/0/0]nhrp network-id 100 [R3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register7.R1、R4间为点到点的GRE
R1:
[R1]int Tunnel 0/0/1 [R1-Tunnel0/0/1]ip add 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.4R4:
[R4]int Tunnel 0/0/1 [R4-Tunnel0/0/1]ip add 10.1.1.4 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.18.配置RIP使整个私有网络基于RIP全网可达
MGRE环境:
R1:
[R1]rip 1 [R1-rip-1]version 2 [R1-rip-1]undo summary [R1-rip-1]network 10.0.0.0 [R1-rip-1]network 192.168.1.0 [R1]int Tunnel 0/0/0 [R1-Tunnel0/0/0]nhrp entry multicast dynamic [R1-Tunnel0/0/0]undo rip split-horizonR2:
[R2]rip 1 [R2-rip-1]version 2 [R2-rip-1]undo summary [R2-rip-1]network 10.0.0.0 [R2-rip-1]network 192.168.2.0 [R2]dis ip routing-table protocol rip [R2-Tunnel0/0/0]undo rip split-horizonR3:
[R3]rip 1 [R3-rip-1]version 2 [R3-rip-1]undo summary [R3-rip-1]network 10.0.0.0 [R3-rip-1]network 192.168.3.0 [R3]dis ip routing-table protocol rip [R3-Tunnel0/0/0]undo rip split-horizonGRE环境:
R1:
[R1]rip 1 [R1-rip-1]version 2 [R1-rip-1]undo summary [R1-rip-1]network 10.0.0.0 [R1-rip-1]network 192.168.1.0R2:
[R4]rip 1 [R4-rip-1]version 2 [R4-rip-1]undo summary [R4-rip-1]network 10.0.0.0 [R4-rip-1]network 192.168.4.09.所有PC设置私有IP为源IP,可以访问R5环回
配置Easy IP:
R1:
[R1]acl 2000 [R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255 [R1-acl-basic-2000]int s4/0/0 [R1-Serial4/0/0]nat outbound 2000R2:
[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 2000R3:
[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 2000R4:
[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/0 [R4-GigabitEthernet0/0/0]nat outbound 2000四. 测试与验证
1.查看中心站点的NHRP表
2.配置MGRE环境中获得的路由信息
PC1 ping PC3:
PC1 ping PC4:
3.GRE环境测试
PC1 ping PC2:
4.Easy IP测试
PC1:
PC2:
PC3:
PC4:
五. 实验总结
本次实验围绕企业多分支网络互联需求,完成了广域网接入认证、VPN 隧道搭建与 RIP 动态路由配置。以 AR5 作为 ISP 公网设备,分别通过 PPP-PAP、PPP-CHAP 和 HDLC 三种方式实现各分支路由器的公网接入;再以 AR1 为 Hub 节点,与 AR2、AR3 构建 MGRE 隧道,与 AR4 搭建 GRE 隧道,将分散的私有网段纳入统一逻辑内网。
实验中,我们通过 RIP 协议实现了私有网络路由同步,最终所有 PC 间均可互相访问,且所有私有 IP 均能成功访问 AR5 的公网环回地址。本次实验不仅验证了不同广域网接入方式的配置与差异,也掌握了 MGRE/GRE 隧道技术的应用场景,加深了对跨公网企业网络模型的理解。