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

测试:

相关推荐
戴为沐13 小时前
Linux内存扩容指南
linux
zylyehuo1 天前
Linux 彻底且安全地删除文件
linux
用户805533698032 天前
主线 U-Boot 上 RK3506:和闭源 rkbin 拔河的三个隐性契约
linux·嵌入式
用户034095297912 天前
linux fcitx 5 雾凇拼音 设置在中文输入法下仍然输入英文标点
linux
Web3探索者3 天前
可视化服务器管理和传统命令行区别是什么?新手教程:Linux 运维到底该用图形界面还是 SSH 命令行?
linux·ssh
zylyehuo3 天前
Linux系统中网线与USB网络共享冲突
linux
Sokach10155 天前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
AlfredZhao5 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3107 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode7 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏