GRE over IPsec VPN配置

【实验目的】

  1. 理解GRE Tunnel的概念。
  2. 理解GRE over IPsec VPN的概念。
  3. 掌握GRE Tunnel的配置。
  4. 掌握GRE over IPsec VPN的配置。
  5. 验证配置。

【实验拓扑】

实验拓扑如下图所示。

实验拓扑

设备参数表如下表所示。

设备参数表

设备

接口

IP地址

子网掩码

默认网关

R1

s0/0

69.1.0.1

255.255.255.0

N/A

g0/0/0

192.168.1.1

255.255.255.0

N/A

R3

s0/0

69.1.0.2

255.255.255.0

N/A

S0/1

201.106.208.1

255.255.255.0

N/A

R2

s0/0

201.106.208.2

255.255.255.0

N/A

g0/0/0

192.168.2.1

255.255.255.0

N/A

PC1

g0/0/0

192.168.1.100

255.255.255.0

192.168.1.1

PC2

g0/0/0

192.168.2.100

255.255.255.0

192.168.2.1

【实验内容】

1.IP地址与路由配置

//R1

enableconf thostname R1interface g0/0/0ip address 192.168.1.1 255.255.255.0no shutdownexitinterface s0/0ip address 69.1.0.1 255.255.255.0no shutdownexit

//R3

conf thostname R3interface s0/0ip address 69.1.0.2 255.255.255.0no shutdowninterface s0/1ip add 201.106.208.1 255.255.255.0no shutdownexit

//R2

enableconf thostname R2interface s0/0ip address 201.106.208.2 255.255.255.0no shutdownexitinterface g0/0/0ip add 192.168.2.1 255.255.255.0no shutdownexit

2.IP地址与路由配置

在路由器R1、R2上配置IP地址,测试各直连链路的连通性,并配置如下路由:

//R1

ip route 0.0.0.0 0.0.0.0 s0/0

//R2

ip route 0.0.0.0 0.0.0.0 s0/0

测试从R1能否ping通R2的公网接口

在R1上追踪路由

R1#traceroute 192.168.2.10

Type escape sequence to abort.

Tracing the route to 192.168.2.10

1 69.1.0.2 0 msec 0 msec 4 msec

2 201.106.208.2 44 msec 4 msec 8 msec

3 192.168.2.10 20 msec 8 msec 24 msec

R1#

3.配置GRE Tunnel

(1)R1的配置

conf t

interface Tunnel0

//创建Tunnel接口,编号为0,编号本地有效

tunnel mode gre ip

//配置Tunnel类型为IPv4 GRE Tunnel

ip address 172.16.0.1 255.255.255.0

//配置Tunnel接口的IP地址,隧道建立后,可以把该隧道看成一条专线

tunnel source Serial0/0

//配置Tunnel接口,路由器将以此接口地址作为Tunnel的源地址封装VPN数据包,也可以直接输入源地址

tunnel destination 201.106.208.2

//配置Tunnel的目的地址,路由器将以此目的地址作为Tunnel的目的地址封装VPN数据包

(2)R2的配置

conf tinterface Tunnel0tunnel mode gre ipip address 172.16.0.2 255.255.255.0tunnel source Serial0/0tunnel destination 69.1.0.1

以上配置完成后,通过ping测试确保隧道两端可达。

R2#ping 172.16.0.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/17/32 ms

R2#

4.配置GRE over IPSEC

(1)R1的配置

conf tcrypto isakmp enablecrypto isakmp policy 10encr 3desauthentication pre-sharegroup 5crypto isakmp key 6 cisco address 201.106.208.2crypto ipsec transform-set TRAN esp-3des esp-sha-hmacip access-list extended Golpermit gre host 69.1.0.1 host 201.106.208.2

//此处应注意,应匹配GRE流量(GRE over IPSec VPN将所有GRE隧道的流量都进行加密),源地址和目的地址应是IPSec物理源接口和物理目的接口的IP地址

crypto map MAP 10 ipsec-isakmpset peer 201.106.208.2set transform-set TRANmatch address Golinterface Serial0/0crypto map MAP

//GRE over IPSec VPN的加密图要应用在物理源接口上

(2)R2的配置

conf tcrypto isakmp enablecrypto isakmp policy 10encr 3desauthentication pre-sharegroup 5crypto isakmp key 6 cisco address 69.1.0.1crypto ipsec transform-set TRAN esp-3des esp-sha-hmacip access-list extended Golpermit gre host 201.106.208.2 host 69.1.0.1crypto map MAP 10 ipsec-isakmpset peer 69.1.0.1set transform-set TRANmatch address Golinterface Serial0/0crypto map MAP

5.配置隧道间路由

//R1

ip route 192.168.2.0 255.255.255.0 Tunnel0

//R2

ip route 192.168.1.0 255.255.255.0 Tunnel0

测试从R1的内网能否ping通R2的内网

6.实验调试

(1)测试两端网络通信

首先检查路由表,输出如下:

R1#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

69.0.0.0/24 is subnetted, 1 subnets

C       69.1.0.0 is directly connected, Serial0/0

172.16.0.0/24 is subnetted, 1 subnets

C       172.16.0.0 is directly connected, Tunnel0

C    192.168.1.0/24 is directly connected, FastEthernet0/0

S    192.168.2.0/24 is directly connected, Tunnel0

S*   0.0.0.0/0 is directly connected, Serial0/0

R1#

从路由器R1上ping通R2局域网网段,触发IPSec隧道建立。

R1#ping 192.168.2.0

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.0, timeout is 2 seconds:

.!!!!

//第一个ICMP数据包触发IPsec建立,因此不可达

Success rate is 100 percent (5/5), round-trip min/avg/max = 12/13/16 ms

R1#

(2)检查IPSec相关情况

首先检查路由表,输出如下:

R1#show crypto ipsec sa

interface: Serial0/0

Crypto map tag: MAP, local addr 69.1.0.1

protected vrf: (none)

local  ident (addr/mask/prot/port): (69.1.0.1/255.255.255.255/47/0)

remote ident (addr/mask/prot/port): (201.106.208.2/255.255.255.255/47/0)

current_peer 201.106.208.2 port 500

PERMIT, flags={origin_is_acl,}

    #pkts encaps: 21, #pkts encrypt: 21, #pkts digest: 21

    #pkts decaps: 21, #pkts decrypt: 21, #pkts verify: 21

#pkts compressed: 0, #pkts decompressed: 0

#pkts not compressed: 0, #pkts compr. failed: 0

#pkts not decompressed: 0, #pkts decompress failed: 0

  #send errors 1, #recv errors 0

//已经有IPSec相关数据包

local crypto endpt.: 69.1.0.1, remote crypto endpt.: 201.106.208.2

path mtu 1500, ip mtu 1500, ip mtu idb Serial0/0

current outbound spi: 0x386E4AE3(946752227)

inbound esp sas:

spi: 0x8384871E(2206500638)

transform: esp-3des esp-sha-hmac ,

in use settings ={Tunnel, }

conn id: 2001, flow_id: SW:1, crypto map: MAP

sa timing: remaining key lifetime (k/sec): (4580078/3181)

IV size: 8 bytes

replay detection support: Y

Status: ACTIVE

inbound ah sas:

inbound pcp sas:

outbound esp sas:

spi: 0x386E4AE3(946752227)

transform: esp-3des esp-sha-hmac ,

in use settings ={Tunnel, }

conn id: 2002, flow_id: SW:2, crypto map: MAP

sa timing: remaining key lifetime (k/sec): (4580078/3179)

IV size: 8 bytes

replay detection support: Y

Status: ACTIVE

outbound ah sas:

outbound pcp sas:

R1#

(3)追踪路由

在R1上面追踪路由,输出如下:

R1#traceroute 192.168.2.10

Type escape sequence to abort.

Tracing the route to 192.168.2.10

  1 172.16.0.2 24 msec 12 msec 12 msec

  2 192.168.2.10 16 msec *  20 msec

R1#

//发现只有两条路由了

在PC1上面追踪路由,输出如下:

记住,进步是一步一步来的。庆祝每一个小小的胜利,并继续朝着你的目标前进。

GRE over IPsec VPN配置相关推荐

  1. GRE over IPSec 隧道配置案例

    我也想要一个美女老师教我学习网络. GRE over IPSec 配置案例 要求 拓扑 配置 基础配置 GRE VPN配置 配置路由 IPSec配置 GRE over IPSec 技术背景 工作流程 ...

  2. 锐捷GRE over ipsec vxn配置 ----尚文网络奎哥

    IPsec vxn作为目前网络中较为常见的VxN技术,存在着不能传递组播流量的缺点,致使使用ipsec vxn不能使用ospf实现网段的动态添加,有内部网段信息改变配置比较麻烦. GRE vpn可以传 ...

  3. 华为路由器 IPSec VPN 配置

    需求: 通过 IPSecVPN 实现上海与成都内网互通 拓扑图如下: 一.首先完成网络配置 1.R1 路由器设置 <Huawei>sys [Huawei]sys R1 [R1]un in ...

  4. eNSP综合实例:防火墙配置GRE over IPSec VPN 网页版

    模拟环境:eNSP 废话:通过命令配置此实验,做了一星期没做通,只好采用WEB配置生成配置信息学习,才有了此内容. 此文为模拟成功后,通过分析配置代码完成,有部分代码做了美化处理,可能存在一定的BUG ...

  5. 三十二、VPN技术概述——GRE、IPSec、MPLS vpn

    文章目录 vpn 简介 用途 优缺 一.GRE-VPN 1.基础配置步骤: 2.可选配置 二.IPSEC-VPN 概述 1.IPSes 特性 2.IPSec 架构 3.IPSec 数据封装 三.GRE ...

  6. 企业网络安全架构设计之IPSec VPN应用配置举例

    文章目录 1. 需求分析 组网拓扑: 组网需求: 2. 地址规划 终端设备地址规划: 网络设备地址规划: 3. 防火墙接口区域规划 4. 分支机构内网配置 LSW4交换机配置 FW1防火墙配置 检查配 ...

  7. Juniper防火墙系列-04-Juniper防火墙IPSec VPN的配置

    Juniper 所有系列防火墙(除部分早期型号外)都支持 IPSec VPN,其配置方式有多种,包括:基于策略的 VPN.基于路由的 VPN.集中星形 VPN 和背靠背 VPN 等.在这里,我们主要介 ...

  8. IPSec VPN原理与配置

    目录 一.实验原理 ipsec vpn的目的 ipsec vpn的原理 二.  IPSec VPN概念 1.什么是IPSec 2.IPSec架构 3.SA  (Security Association ...

  9. IPSec隧道配置案例(手动模式)

    IPSec有点难需要掌握他的逻辑及框架然后就简单了 网络攻城狮眼里的烟花! IPSec VPN 配置案例 要求 拓扑 配置 基础配置 IPSec VPN配置 分析原因 解决方法 IPSec VPN I ...

最新文章

  1. Python使用matplotlib可视化条形图(bar plot)、自定义在条形图的顶部添加数值标签(Bar Chart)
  2. jvm性能调优实战 -55RPC调用引发的OOM故障
  3. android动态jar,Android动态加载Jar(包含第三方依赖Jar)
  4. //yield return用于无缝实现迭代模式。
  5. hdu 4501 多维0-1背包
  6. matlab2016b ubuntu命令行安装 + matconvnet的安装
  7. 对php程序的理解,小魏谈对于php程序的理解
  8. 函数计算如何粘合云服务,提供端到端解决方案
  9. [转载] 扩展Python之在Python中调用C编写的函数模块
  10. Android 隐藏环形进度条,Android环形进度条
  11. 从零开始学人工智能--统计学习:统计学习基础知识
  12. 服装erp系统的设计方案
  13. 怎样把孩子写的日记或作文制成电子版呢?
  14. krpano使用gyro2.js自定义陀螺仪
  15. 从零搭建Spring Boot脚手架(2):增加通用的功能(转载)
  16. 你还要我怎样计算机音乐,你还要我怎样是什么歌抖音?
  17. 教你三分钟了解PS技术
  18. java 之file文件/目录创建
  19. 在css中如何调整字间距?
  20. 2018年,中国空气质量在全球的排名,你一定想不到!

热门文章

  1. 一个前端失败者的自我剖析与反思
  2. java扫雷的设计思路_扫雷设计思路
  3. RPC service
  4. linux安装压缩文件的工具,centos上安装rar工具
  5. 解决进不了网页,检查问题为DNS error(以连接校园网进不去教务系统为例)
  6. linux创建word文件格式,WORD文档格式要求与linux学习规划
  7. 拨号上网、热点分享问题
  8. requestPermissions 请求权限 (中文翻译小组)
  9. MySQL数据库综合练习四
  10. 赛前注意事项+客观题~~~