ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

GRE over IPSec 隧道配置案例

2021-11-16 21:02:55  阅读:294  来源: 互联网

标签:esp ip over 12.0 add GRE IPSec


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
在这里插入图片描述
PC2
在这里插入图片描述

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邻居建立成功
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

通过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可以互访
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

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

GRE over IPSec

技术背景

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

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

工作流程

首先通过GRE对报文进行封装,然后再由IPSec对封装后的报文进行加密和传输。
在这里插入图片描述

GRE报文上封装IPSec报文

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

标签:esp,ip,over,12.0,add,GRE,IPSec
来源: https://blog.csdn.net/wangyuxiang946/article/details/121365050

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有