GRE VPN和MGRE VPN综合练习

GRE VPN和MGRE VPN综合练习

  • 实验拓扑
  • 实验要求

1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址;

2、R1和R5间使用PPP的PAP认证,R5为主认证方;

R2与R5之间使用ppp的CHAP认证,R5为主认证方;

R3与R5之间使用HDLC封装;

3、R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE;

4、整个私有网络基本RIP全网可达,

5、所有Pc设置私有IP为源IP,可以访问R5环回,达到全网通。

三、实验思路

1、对四台PC和五台路由器进行IP地址的配置

2、R1和R5间使用PPP的PAP认证,R5为主认证方 R5上配置aaa服务创建用户及密码R1在接口上选择身份验证模式PAP

3、R2与R5之间使用ppp的CHAP认证,R5为主认证方 R5上配置aaa R2在接口上选择身份验证模式CHAP

4、分别在R3R5上做HDLC封装

5、将公网内的网络实现全网通

6、R1、R2、R3构建一个MGRE环境,R1为中心站点,

7、R1、R4间为点到点的GRE

8、使用rip动态路由协议使所有私网地址和隧道地址进行路由学习

9、在R1\R2\R3\R4上做NAT地址转换技术(一对多)

四、实验步骤

1、IP地址配置

R1

r1int g0/0/0

r1-GigabitEthernet0/0/0ip add 192.168.1.254/24

r1-GigabitEthernet0/0/0int s3/0/0

r1-Serial3/0/0ip add 15.1.1.1 24

R2

r2int g 0/0/0

r2-GigabitEthernet0/0/0

r2-GigabitEthernet0/0/0ip add 192.168.2.254 24

r2-GigabitEthernet0/0/0int s 3/0/1

r2-Serial3/0/1ip add 25.1.1.1 24

R3

r3int g 0/0/0

r3-GigabitEthernet0/0/0ip add 192.168.3.254 24

r3-GigabitEthernet0/0/0int s 4/0/0

r3-Serial4/0/0ip add 35.1.1.1 24

R4

r4int g 0/0/0

r4-GigabitEthernet0/0/0ip add 192.168.4.254 24

r4-GigabitEthernet0/0/0int g 0/0/1

r4-GigabitEthernet0/0/1ip add 45.1.1.1 24

R5

ISPint Serial 3/0/0

ISP-Serial3/0/0ip add 15.1.1.2 24

ISP-Serial3/0/0int s 3/0/1

ISP-Serial3/0/1ip add 25.1.1.2 24

ISP-Serial3/0/1int s 4/0/0

ISP-Serial4/0/0ip add 35.1.1.2 24

ISP-Serial4/0/0int g 0/0/1

ISP-GigabitEthernet0/0/1ip add 45.1.1.2 24

ISP-GigabitEthernet0/0/1int l 0

ISP-LoopBack0ip add 5.5.5.5 24

2、R1和R5间使用PPP的PAP认证,R5为主认证方

首先需要在R5上通过aaa服务建立用户和密码,进入对应接口选择身份验证模式

ISPaaa

ISP-aaalocal-user liu password cipher 111

ISP-aaalocal-user liu service-type ppp

ISPint Serial 3/0/0

ISP-Serial3/0/0ppp authentication-mode pap

然后我们先不在R1上做认证,重启链路看看效果

可以看到因为R1上没做pap认证导致接口的链路层协议down

所以在R1上也要做pap认证

r1-Serial3/0/0ppp pap local-user liu password cipher 111

然后我们再来测试一下

这里我们可以很明显的观察到物理层和数据链路层双up

3、R2与R5之间使用ppp的CHAP认证,R5为主认证方

首先需要在R5上通过aaa服务建立用户和密码,进入对应接口选择身份验证模式

ISPaaa

ISP-aaalocal-user liu password cipher 111

ISP-aaalocal-user liu service-type ppp

ISPint s 3/0/1

ISP-Serial3/0/1ppp authentication-mode chap

然后再R2上做chap认证

r2int s 3/0/1

r2-Serial3/0/1ppp chap user liu

r2-Serial3/0/1ppp chap password cipher 111

4、R3与R5之间使用HDLC封装

ISPint s 4/0/0

ISP-Serial4/0/0link-protocol hdlc

Warning: The encapsulation protocol of the link will be changed. Continue? Y/N

:y

r3int s 4/0/0

r3-Serial4/0/0link-protocol hdlc

Warning: The encapsulation protocol of the link will be changed. Continue? Y/N

:y

5、将公网内的网络实现全网通

在R1\R2\R3\R4做一条指向公网的缺省路由

r1ip route-static 0.0.0.0 0 15.1.1.2

r2ip route-static 0.0.0.0 0 25.1.1.2

r3ip route-static 0.0.0.0 0 35.1.1.2

r4ip route-static 0.0.0.0 0 45.1.1.2

6、R1、R2、R3构建一个MGRE环境,R1为中心站点,

1)首先要分别在R1\R2\R3上做隧道接口

R1

r1int Tunnel 0/0/0

r1-Tunnel0/0/0ip add 10.1.1.1 24

r1-Tunnel0/0/0tunnel-protocol

r1-Tunnel0/0/0tunnel-protocol gre p2mp

r1-Tunnel0/0/0source 15.1.1.1

Jul 25 2024 21:32:15-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/0nhrp network-id 100

R2、

r2int Tunnel 0/0/0

r2-Tunnel0/0/0ip add 10.1.1.2 24

r2-Tunnel0/0/0tunnel-protocol gre p2mp

r2-Tunnel0/0/0source Serial 3/0/1

Jul 25 2024 21:34:48-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/0nhrp network-id 100

r2-Tunnel0/0/0nhrp entry 10.1.1.1 15.1.1.1 register

R3、

r3int Tunnel 0/0/0

r3-Tunnel0/0/0ip add 10.1.1.3 24

r3-Tunnel0/0/0tunnel-protocol gre p2mp

r3-Tunnel0/0/0source Serial 4/0/0

Jul 25 2024 21:39:50-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/0nhrp network-id 100

r3-Tunnel0/0/0nhrp entry 10.1.1.1 15.1.1.1 register

2)用rip动态路由协议将私网网段搞通

r2rip 1

r2-rip-1v 2

r2-rip-1undo summary

r2-rip-1network 192.168.2.0

r2-rip-1network 10.0.0.0

其他同上

3)在R1上开启伪广播

r1int Tunnel 0/0/0

r1-Tunnel0/0/0nhrp entry multicast dynamic

4)关闭rip的水平分割

r1-Tunnel0/0/0undo rip split-horizon

7、R1、R4间为点到点的GRE

1)配置gre所需的隧道接口

r1int Tunnel 0/0/1

r1-Tunnel0/0/1ip add 10.1.2.1 24

r1-Tunnel0/0/1tunnel-protocol gre

r1-Tunnel0/0/1source 15.1.1.1

r1-Tunnel0/0/1destination 45.1.1.1

Jul 25 2024 23:27:01-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

r4int Tunnel 0/0/1

r4-Tunnel0/0/1ip add 10.1.2.2 24

r4-Tunnel0/0/1tunnel-protocol gre

r4-Tunnel0/0/1source 45.1.1.1

r4-Tunnel0/0/1destination 15.1.1.1

Jul 25 2024 23:28:05-08:00 r4 %%01IFNET/4/LINK_STATE(l)0:The line protocol IP

on the interface Tunnel0/0/1 has entered the UP state.

8、所有Pc设置私有IP为源IP,可以访问R5环回,达到全网通。

1)使用NAT技术,将私网转换成公网(一对多)

2)首先需要抓取私网流量

R1

r1acl 2000

r1-acl-basic-2000rule permit source 192.168.1.0 0.0.0.255

r1-acl-basic-2000q

r1int s 3/0/0

r1-Serial3/0/0nat outbound 2000

R2

r2acl 2000

r2-acl-basic-2000rule permit source 192.168.2.0 0.0.0.255

r2-acl-basic-2000q

r2int s 3/0/1

r2-Serial3/0/1nat outbound 2000

R3

r3acl 2000

r3-acl-basic-2000rule permit source 192.168.3.0 0.0.0.255

r3-acl-basic-2000q

r3int s 4/0/0

r3-Serial4/0/0nat outbound 2000

R4

r4acl 2000

r4-acl-basic-2000rule permit source 192.168.4.0 0.0.0.255

r4-acl-basic-2000q

r4int g 0/0/1

r4-GigabitEthernet0/0/1nat outbound 2000

测试:

相关推荐
一技安身几秒前
MySQL 8.4.13 LTS 通用二进制包(Linux免安装版)完整教程
linux·mysql·adb
迷途之人不知返4 分钟前
【动态库与静态库】-3-静态链接与加载
linux
xiaoye-duck11 分钟前
《C++ 项目:手写大模型接入 SDK》DeepSeek接口设计(上):初始化和全量响应
开发语言·网络·c++·语言模型
Gauss松鼠会14 分钟前
GaussDB 中 gsql 与 DBeaver(JDBC)客户端工具查询时间不一致:原因、排查与处理
运维·服务器·数据库·sql·gaussdb·经验总结
谙弆悕博士35 分钟前
debian快速换源
linux·运维·windows·debian·下载·换源·网络问题
Yang961139 分钟前
鼎讯信通热剥钳实测:大芯径光纤如何做到无损剥除
网络
.道阻且长.43 分钟前
Linux基本开发工具:编译器gcc/g++
linux·运维·服务器·职场和发展
Industio_触觉智能1 小时前
瑞芯微RK系列调试工具与量产测试手册-上|串口日志打通与JTAG兜底调试
linux·sdk·jtag·瑞芯微·调试工具·rk3576·量产调试
贞明电子9 小时前
工业三色报警灯怎么接入项目系统?开关量与RS485控制应用指南
运维·网络·微信公众平台·贞明电子
HideF9 小时前
Linux
linux·服务器·网络