400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

GNS3配置GRE

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隧道。此时就可以通过私网正常互通了。


本文名称:GNS3配置GRE
标题来源:http://mbwzsj.com/article/jpcecc.html

其他资讯

让你的专属顾问为你服务