华为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 对端物理接口地址
- 策略应用在物理接口上
- 支持组播,可跑动态路由器协议
1万+

被折叠的 条评论
为什么被折叠?



