分享

华为路由器 IPSec 与 GRE 结合实验

 新用户16501297 2021-04-15

优质文章,及时送达

图片

大家好,今天给大家带来的是华为GRE/IPSEC,本篇文章也是应粉丝要求所写。直接开始:

二者结合的目的

GRE 支持单播、组播、广播,IPSec 仅支持单播。GRE 不支持对于数据完整性以及身份认证的验证功能,并且也不具备数据加密保护。而 IPSec 恰恰拥有强大的安全机制。达到了互补的功效!

GRE

GRE(Generic Routing Encapsulation,通用路由封装)协议是对某些网络层协议(IPX, AppleTalk, IP, IPSec, DVMRP, etc.)的数据报文进行封装,使这些被封装的数据报文能够在另一个网络层协议(如IP)中传输。GRE采用了Tunnel(隧道)技术,是VPN(Virtual Private Network)的第三层隧道协议。

IPSec

图片

IPsec(IP Security)是IETF制定的三层隧道加密协议,它为Internet上传输的数据提供了高质量的、可互操作的、基于密码学的安全保证。特定的通信方之间在IP层通过加密与数据源认证等方式,提供了以下的安全服务:

  • 数据机密性(Confidentiality):IPsec发送方在通过网络传输包前对包进行加密。
  • 数据完整性(Data Integrity):IPsec接收方对发送方发送来的包进行认证,以确保数据在传输过程中没有被篡改。
  • 数据来源认证(Data Authentication):IPsec在接收端可以认证发送IPsec报文的发送端是否合法。
  • 防重放(Anti-Replay):IPsec接收方可检测并拒绝接收过时或重复的报文。
图片

通俗来说,GRE over IPSec是将GRE流量作为私网流量进行加密,GRE隧道的建立以及隧道中传输的流量都会被加密;而IPSec over GRE是在GRE隧道建立的基础之上,进行私网数据的加密,与普通的IPSec相比,区别仅仅是私网流量从哪转发就从哪进行加密。纯IPSec流量从公网接口转发,将策略应用在公网接口;IPSec over GRE只是因为私网流量从隧道转发,将策略应用在了Tunnel接口下。

实际应用中,经常会出现IPsec、GRE、NAT、PPPoE等各种协议综合应用,但只要了解其中原理,实施起来并不复杂。

实验拓扑

图片

各路由器配置

R1
sysname R1

ipsec proposal lance-proposal
esp authentication-algorithm sha1

ike peer lance-peer v2
pre-shared-key cipher huawei
 
ipsec profile lance
ike-peer lance-peer
proposal lance-proposal

interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 202.100.1.1 255.255.255.0 

interface Tunnel0/0/0
ip address 123.1.1.1 255.255.255.0 
tunnel-protocol gre
source 202.100.1.1
destination 61.128.1.1
gre key 1234
ipsec profile lance

ip route-static 61.128.1.0 255.255.255.0 202.100.1.10
R2
sysname R2

interface GigabitEthernet0/0/0
ip address 202.100.1.10 255.255.255.0 
interface GigabitEthernet0/0/1
ip address 61.128.1.10 255.255.255.0 
R3
sysname R3

ipsec proposal lance-proposal
esp authentication-algorithm sha1

ike peer lance-peer v2
pre-shared-key cipher huawei

ipsec profile lance
ike-peer lance-peer
proposal lance-proposal

interface GigabitEthernet0/0/0
ip address 10.0.0.1 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 61.128.1.1 255.255.255.0 

interface Tunnel0/0/0
ip address 123.1.1.2 255.255.255.0 
tunnel-protocol gre
source 61.128.1.1
destination 202.100.1.1
gre key 1234
ipsec profile lance

ip route-static 0.0.0.0 0.0.0.0 61.128.1.10

抓包结果

图片

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多