路由器GRE over IPSec站点到站点VPN
         问题分析:对于前面的经典的IPSec VPN的配置来说,兼容性较好,适合于多厂商操作的时候,但是这种经典的配置方式不适合在复杂的网路中配置,如下:

这样在site 1和site 2后面有很多的网络,这样出现的难题是:
           *没有虚拟隧道接口,不能让两个站点的动态路由协议贯通
           *由于没有虚拟隧道接口,所以很难对通信点之间的明文数据流进行控制(ACL、NAT、QoS)
           *感兴趣流多,是两个站点的组合数,网络多的话,感兴趣流也多
——为了解决这一缺陷,那么Cisco提供两种方案,一种是GRE(IOS 12.4之前推荐),一种是SVTI(IOS 12.4以后的路由器推荐)。
         分析GRE是如何解决经典配置的问题的:1、GRE上运行OSPF,这样可以实现内部互学路由;2、可以在GRE隧道接口配置ACL等控制;3、感兴趣流最终会是站点之间的GRE流量。GRE over IPSec 属于典型的传输模式的IPSec VPN(因为加密点=通信点)。
实验拓扑:

默认基本配置完成
Site1:
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2
R1(config)#in tunnel 13
R1(config-if)#ip add 13.1.1.1 255.255.255.0
R1(config-if)#tunnel source 12.1.1.1
R1(config-if)#tun destination 23.1.1.3
R1(config-if)#end
R1#ping 13.1.1.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 136/162/180 ms
R1(config)#router os 1
R1(config-router)#network  13.1.1.0 0.0.0.255 a 0
R1(config-router)#net 1.1.1.0 0.0.0.255 a 0
R1(config-router)#router-id 1.1.1.1
R1(config-router)#end
R1#sho ip ro ospf
Codes: L - local, 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, + - replicated route

Gateway of last resort is 12.1.1.2 to network 0.0.0.0

3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/1001] via 13.1.1.3, 00:00:08, Tunnel13
R1(config)#crypto isakmp  enable
R1(config)#crypto  is policy  10
R1(config-isakmp)#authentication  pre-share
R1(config-isakmp)#exi
R1(config)#crypto isakmp key 0 cisco address 23.1.1.3
R1(config)#ip access-list extended vpn
R1(config-ext-nacl)#permit gre 12.1.1.0 0.0.0.255 23.1.1.0 0.0.0.255
R1(config-ext-nacl)#exi
R1(config)#crypto  ipsec transform-set trans esp-des esp-md5-hmac
R1(cfg-crypto-trans)#mode transport
R1(cfg-crypto-trans)#exi
R1(config)#crypto  map cisco 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
        and a valid access list have been configured.
R1(config-crypto-map)#match  address vpn
R1(config-crypto-map)#set peer 23.1.1.3
R1(config-crypto-map)#set  transform-set trans
R1(config-crypto-map)#int f1/0
R1(config-if)#crypto  map cisco
R1#ping 3.3.3.3 so 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 208/243/264 ms
R1#sho crypto  en connections  active
Crypto Engine Connections

ID  Type    Algorithm           Encrypt  Decrypt LastSeqN IP-Address
    1  IPsec   DES+MD5                   0       15       17 12.1.1.1
    2  IPsec   DES+MD5                   8        0        0 12.1.1.1
 1001  IKE     SHA+DES                   0        0        0 12.1.1.1
Site2
R3(config)#ip route 0.0.0.0 0.0.0.0 23.1.1.2
R3(config)#end
R3(config)#int tu 13
R3(config-if)#tun so 23.1.1.3
R3(config-if)#tun destination  12.1.1.1
R3(config-if)#ip add 13.1.1.3 255.255.255.0
R3(config)#ro
R3(config)#router os 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 3.3.3.0 0.0.0.255 a 0
R3(config-router)#net 13.1.1.0 0.0.0.255 a 0
R3(config-router)#end
R3(config)#crypto  is enable
R3(config)#crypto  isakmp  po 10
R3(config-isakmp)#authentication  pre-share
R3(config-isakmp)#exi
R3(config)#crypto  isakmp  key  0 cisco address 12.1.1.1
R3(config)#ip access-list extended vpn
R3(config-ext-nacl)#permit  gre 23.1.1.0 0.0.0.255 12.1.1.0 0.0.0.255
R3(config-ext-nacl)#exi
R3(config)#crypto ipsec transform-set trans esp-des esp-md5-hmac
R3(cfg-crypto-trans)#mode transport
R3(cfg-crypto-trans)#exi
R3(config)#crypto map cisco 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
        and a valid access list have been configured.
R3(config-crypto-map)#set peer 12.1.1.1
R3(config-crypto-map)#set transform-set trans
R3(config-crypto-map)#match  address vpn
R3(config-crypto-map)#int f1/0
R3(config-if)#crypto map  cisco
除此之外,可以直接使用下面的配置来代替crypto map。解释一下,注意这个IPSec profile的运用位置,是隧道接口,并且使用的关键字是tunnel protection,显然使用这个IPSec profile来保护隧道的,那隧道中的流量自然就得以保护,而这流量就是感兴趣流,那么流量而动另一端肯定是对等体的目的地址,那么就不需要设置peer和match address了
Site1(config)#crypto ipsec profile IPSecPro //名字
Site1(ipsec-profile)#set transform-set trans
Site1(ipsec-profile)#int tun 13
Site1(config-if)#tunnel protection ipsec profile IPSecPro

Site2(config)#crypto  ipsec  profile IPSecPro
Site2(ipsec-profile)#set transform-set trans
Site2(ipsec-profile)#int tun 13
Site2(config-if)#tunnel protection ipsec profile IPSecPro

GRE Over IPSec配置的更多相关文章

  1. 动态的GRE OVER IPSEC的实验模拟与分析

    此篇博客正在介绍的是下图中的Dynamic P2P GRE OVER IPSEC VPN: 为什么出现这种动态的GRE OVER IPSEC VPN技术呢? 首先在前面几篇博客中已经介绍过了,动态是为 ...

  2. netsh导入导出IPSec配置策略

    首先提一句: ipsec规则中,filter action为允许的比拒绝的优先级要高,其它的没有顺序关系,经测试验证! 参考:http://tech.techweb.com.cn/thread-354 ...

  3. ipsec配置strongswan.conf和ipsec.conf

    配置strongswan.conf vi /usr/local/etc/strongswan.conf # strongswan.conf - strongSwan configuration fil ...

  4. 思科CISCO ASA 5521 防火墙 Ipsec 配置详解

    版本信息: Cisco Adaptive Security Appliance Software Version 9.9(2) Firepower Extensible Operating Syste ...

  5. 为何GRE可以封装组播报文而IPSEC却不行?

    Author       : Email         : vip_13031075266@163.com Date          : 2021.01.24 Copyright : 未经同意不得 ...

  6. 华为路由器GRE配置

    1. 协议简介 gre(generic routing encapsulation,通用路由封装)协议是对某些网络层协议(如ip 和ipx)的数据报进行封装,使这些被封装的数据报能够在另一个网络层协议 ...

  7. openwrt配置strongswan对接hillstone ipsec的笔记

    一.主要参考资料: https://openwrt.org/docs/guide-user/services/vpn/ipsec/strongswan/roadwarrior https://open ...

  8. 华三F100系列防火墙 、华为USG6300系列防火 GRE 隧道配置

    GRE概述: 通用路由封装(GRE: Generic Routing Encapsulation)是通用路由封装协议,可以对某些网络层协议的数据报进行封装,使这些被封装的数据报能够在IPV4网络中传输 ...

  9. gre tunnel

    http://searchenterprisewan.techtarget.com/tip/GRE-tunnel-vs-IPsec-tunnel-What-is-the-difference Enca ...

随机推荐

  1. awk从放弃到入门(1):awk基础

    一.awk简介 awk其名称得自于它的创始人 Alfred Aho .Peter Weinberger 和 Brian Kernighan 姓氏的首个字母.实际上 AWK 的确拥有自己的语言: AWK ...

  2. DFT 问答 II

    1. Boundary Scan A:Boundary scan 顾名思义,是附加在芯片I/O 周边的扫描测试链,它通过专门的测试端口(TAP)访问.在测试模式下,边界扫描链会接管功能逻辑,对I/O进 ...

  3. Bugku - Misc图穷匕见 - Writeup

    Bugku - Misc图穷匕见 - Writeup 原文链接:http://www.cnblogs.com/WangAoBo/p/6950547.html 题目 给了一个jpg图片,下载图片 分析 ...

  4. 牛客腾讯2020校园招聘-后台&综合-第一次笔试

    第一题 Q: 小Q想要给他的朋友发送一个神秘字符串,但是他发现字符串的过于长了,于是小Q发明了一种压缩算法对字符串中重复的部分进行了压缩,对于字符串中连续的m个相同字符串S将会压缩为m|S,例如字符串 ...

  5. Js将字符串转换成对象或数组en

    举个例子 var test='{ colkey: "col", colsinfo: "NameList" }' a.将文本转换成对象 var test='{ c ...

  6. JSP中四大作用域详解

    四大作用域 为了在页面.请求.和用户之间传递和共享数据,JSP提供了四个不同的作用域:page(页面作用域).request(请求作用域).session(会话作用域).application(应用程 ...

  7. buuctf 基础破解

    首先下载压缩包 解压之后发现是另一个压缩包 另一个压缩包上写着基础破解 然后用暴力破解的方法破解 然后搜了一下 暴力破解一般的长度是多少 然后搜到的结果是 长度为8的时候电脑都要破解好几年 所以我猜测 ...

  8. bugku web 5

    首先进入网站http://123.206.87.240:8002/web5/index.php 进入之后就会看到 然后点击F12就会打开后台 然后就会发现有一串东西就是这个然后经过搜索是jsfuck ...

  9. pytorch数学运算与统计属性入门(非常易懂)

    pytorch数学运算与统计属性入门1.Broadcasting (维度)自动扩展,具有以下两个重要特征:(1)expand (2)without copying data重点的核心实现功能是:(1) ...

  10. 数据库程序接口——JDBC——API解读第一篇——建立连接的核心对象

    结构图 核心对象 Driver Java通过Driver接口表示驱动,每种类型的数据库通过实现Driver接口提供自己的Driver实现类. Driver由属性,操作,事件三部分组成. 属性 公共属性 ...