GRE over IPSec 隧道配置案例

本文阅读 2 分钟
首页 安全分享,WEB安全 正文

acl 3001 rule permit ip

int g0/0/0 ip add 192.168.10.254 24 dhcp sel int int g0/0/1 ip add 12.0.0.1 24 nat outbound 3001

ip route-s 0.0.0.0 0 12.0.0.2

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

上海总部IP地址、DHCP、NAT、路由

sys
sys SH
dhcp enable

acl 3001 rule permit ip

int g0/0/1 ip add 192.168.20.254 24 dhcp sel int int g0/0/0 ip add 23.0.0.3 24 nat outbound 3001

ip route-s 0.0.0.0 0 23.0.0.2

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

ISP公网

sys
sys ISP

int g0/0/0 ip add 12.0.0.2 24

int g0/0/1 ip add 23.0.0.2 24

int lo 2 ip add 2.2.2.2 32

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

PC1 img PC2 img

GRE VPN配置

青海分部

interface Tunnel0/0/1
tunnel-protocol gre
source 12.0.0.1
destination 23.0.0.3
ip add 172.16.13.1 24

 
 
 
 
  1
  2
  3
  4
  5

上海总部

interface Tunnel0/0/1
tunnel-protocol gre
source 23.0.0.3
destination 12.0.0.1
ip add 172.16.13.3 24

 
 
 
 
  1
  2
  3
  4
  5

配置路由

青海分部

ospf  1 router-id 1.1.1.1
area 0
net 192.168.10.0 0.0.0.255
net 172.16.13.0 0.0.0.255

 
 
 
 
  1
  2
  3
  4

上海总部

ospf  1 router-id 3.3.3.3
area 0
net 192.168.20.0 0.0.0.255
net 172.16.13.0 0.0.0.255

 
 
 
 
  1
  2
  3
  4

OSPF邻居建立成功 img

img img

通过GRE隧道的hello包没有加密无安全性。 解决方法:在GRE数据包外面加IPSec的ESP数据包使得hello数据包有安全性。

IPSec配置

青海分部

感兴趣流
acl 3000  
 rule 5 permit gre sou 12.0.0.1 0 des 23.0.0.3 0
 ##GRE流量没有安全性,对GRE流量做保护

提议: ipsec proposal QH2SH esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256

策略: ipsec policy QH2SH 1 manual security acl 3000 proposal QH2SH tunnel local 12.0.0.1 tunnel remote 23.0.0.3 sa spi inbound esp 12345 sa string-key inbound esp cipher huawei123 sa spi outbound esp 12345 sa string-key outbound esp cipher huawei123

公网接口调用: ipsec policy QH2SH

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

上海总部

感兴趣流:
acl 3000
rule 5 permit gre so 23.0.0.3 0 de 12.0.0.1 0

提议: ipsec proposal SH2QH esp authentication-algorithm sha2-256 esp encryption-algorithm aes-256

策略: ipsec policy SH2QH 1 manual security acl 3000 proposal SH2QH tunnel local 23.0.0.3 tunnel remote 12.0.0.1 sa spi inbound esp 12345 sa string-key inbound esp cipher huawei123 sa spi outbound esp 12345 sa string-key outbound esp cipher huawei123

公网接口调用: ipsec policy SH2QH

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

VPN没有一点问题,PC1和PC2可以互访 img img

img img

公网数据包不做保护 VPN数据加密,即使是运营商也没办法解密知道里面的数据是啥!!!

技术背景

• IPSec VPN用于在两个端点之间提供安全的IP通信,但只能加密并传播单播 数据,无法加密和传输语音、视频、动态路由协议信息等组播数据流量。 • GRE可以封装组播数据,并可以和IPSec结合使用,从而保证语音、视频等组播业务的安全。

总结一下就是两个VPN互补各自的缺点

工作流程

首先通过GRE对报文进行封装,然后再由IPSec对封装后的报文进行加密和传输。 img

GRE报文上封装IPSec报文

img img img

本文为互联网自动采集或经作者授权后发布,本文观点不代表立场,若侵权下架请联系我们删帖处理!文章出自:https://blog.csdn.net/wangyuxiang946/article/details/121365050
-- 展开阅读全文 --
BUUCTF Web [极客大挑战 2019]Knife
« 上一篇 06-24
安全面试之XSS(跨站脚本攻击)
下一篇 » 07-24

发表评论

成为第一个评论的人

热门文章

标签TAG

最近回复