华为GRE和IPSEC配置

华为GRE和IPSEC配置,Gre over Ipsec

GRE配置

A(1.1.1.1)端配置
interface Tunnel1
 description To-B
 ip address 172.31.255.1 255.255.255.252
 tunnel-protocol gre
 keepalive
 source 1.1.1.1
 destination 2.2.2.2
 gre key cipher 123456
 
B(2.2.2.2)端配置
interface Tunnel1
 description To-A
 ip address 172.31.255.2 255.255.255.252
 tunnel-protocol gre
 keepalive
 source 2.2.2.2
 destination 1.1.1.1
 gre key cipher 123456
 
IPSEC配置

A(1.1.1.1)端配置
定义需要加密的ACL
acl number 3000
 rule 5 permit ip source 1.1.1.1 0 destination 2.2.2.2 0

ipsec proposal prop-to-B
 esp authentication-algorithm sha2-256
 esp encryption-algorithm aes-256

ike proposal 99
 encryption-algorithm aes-256
 dh group14
 authentication-algorithm sha2-256
 authentication-method pre-share
 integrity-algorithm hmac-sha2-256
 prf hmac-sha2-256
 
ike peer ike-to-B
 pre-shared-key Admin@123456
 ike-proposal 99
 remote-address 2.2.2.2

ipsec policy ipsec-to-B 1 isakmp
 security acl 3000
 ike-peer ike-to-B
 proposal prop-to-B
 alias ipsec-policy-to-B

ipsec policy应用到接口

B(2.2.2.2)端配置
定义需要加密的ACL
acl number 3000
 rule 5 permit ip source 2.2.2.2 0 destination 1.1.1.1 0

ipsec proposal prop-to-A
 esp authentication-algorithm sha2-256
 esp encryption-algorithm aes-256

ike proposal 99
 encryption-algorithm aes-256
 dh group14
 authentication-algorithm sha2-256
 authentication-method pre-share
 integrity-algorithm hmac-sha2-256
 prf hmac-sha2-256
 
ike peer ike-to-A
 pre-shared-key Admin@123456
 ike-proposal 99
 remote-address 1.1.1.1

ipsec policy ipsec-to-A 1 isakmp
 security acl 3000
 ike-peer ike-to-A
 proposal prop-to-A
 alias ipsec-policy-to-A

ipsec policy应用到接口

在某些情况下,设备之间的兼容性问题可能导致GRE隧道断开。可以尝试重置IKE SA和IPsec SA

reset ipsec sa

reset ike sa

  • IPSec over GRE

    • 在 GRE 隧道内传输数据之前,首先对数据进行 IPSec 加密。
    • 这种方式下,GRE 只是充当了一个传输数据的隧道,而加密的工作由 IPSec 执行。具体来说,数据包在通过 GRE 隧道传输之前会被 IPSec 加密,并且只加密数据负载部分。
    • 工作流程:数据 → 加密 (IPSec) → GRE 隧道封装 → 发送
    • IKE-Peer remote address 对端Tunnel口地址
    • 策略应用在Tunnel上
  • GRE over IPSec

    • 在 GRE 隧道内封装数据后,整个 GRE 隧道(包括头部和数据)会通过 IPSec 进行加密。
    • 这种方式下,GRE 隧道先建立,然后 IPSec 对整个 GRE 隧道进行加密保护,包括 GRE 头和 GRE 内部的所有数据包。
    • 工作流程:数据 → GRE 隧道封装 → 加密 (IPSec) → 发送
    • IKE-Peer remote address 对端物理接口地址
    • 策略应用在物理接口上
    • 支持组播,可跑动态路由器协议
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

强力运维

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值