GNS3 配置GRE

发布时间:2020-08-29 07:52:57 作者:开源殿堂
来源:网络 阅读:491

1、简述

GRE(Generic Routing Encapsulation)GRE是一种最传统的隧道协议,其根本功能就是要实现隧道功能,以实现异地网络之间可以通过内部私网相互访问。

GNS3 配置GRE


以上图为例,假设IP地址为10.1.1.1的XP1想访问IP地址为192.168.1.1的XP2,其流程大致如下:


2、基础网络配置。

R1配置:

interface FastEthernet0/0

 ip address 12.1.1.1 255.255.255.0

interface FastEthernet1/0

 ip address 13.1.1.1 255.255.255.0

R2配置:

interface FastEthernet0/0

 ip address 12.1.1.2 255.255.255.0

interface FastEthernet1/0

 ip address 10.1.1.254 255.255.255.0

ip route 0.0.0.0 0.0.0.0 12.1.1.1

R3配置:

interface FastEthernet0/0

 ip address 13.1.1.3 255.255.255.0

interface FastEthernet1/0

 ip address 192.168.1.254 255.255.255.0.3

ip route 0.0.0.0 0.0.0.0 13.1.1.1

此时XP1和XP2是无法通过私网互通的。


3、GRE配置

R2配置:

interface Tunnel2

 ip address 1.1.1.1 255.255.255.252

 tunnel source 12.1.1.2

 tunnel destination 13.1.1.3

R3配置:

interface Tunnel3

 ip address 1.1.1.2 255.255.255.252

 tunnel source 13.1.1.3

 tunnel destination 12.1.1.2

此时XP1和XP2依旧无法通过私网互通的,是因为此时数据包是通过物理口将数据发送出去的,而到达公网后,因为公网没有私网的路由而将数据包丢弃。


4、GRE路由配置。

R2配置:

ip route 192.168.1.0 255.255.255.0 Tunnel2

R3配置:

ip route 10.1.1.0 255.255.255.0 Tunnel3

配置GRE路由之后,所有前往私网的数据包都走GRE隧道。此时就可以通过私网正常互通了。

推荐阅读:
  1. GNS3优化
  2. 简单介绍GNS3

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

gns3 配置gre(generic r gr

上一篇:详解python项目实战:模拟登陆CSDN

下一篇:Spring Cloud应用实现配置自动刷新过程详解

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》