华为防火墙 IPSec over GRE 配置

在这里插入图片描述

IPsec

主要作用是对数据进行加密,因为他能提供所有有时候被单独用作实现加密的一种方法!IPsec建立的是一个逻辑隧道,并不是真正意义上的隧道!并且不能提供路由功能,因为IPsec不支持非ip流量,也不支持广播(组播)!

GRE
    GRE是一种三层VPN封装技术。GRE可以对某些网络层协议(如IPX、Apple Talk、IP等)的报文进行封装,使封装后的报文能够在另一种网络中(如IPv4)传输,从而解决了跨越异种网络的报文传输问题,虽然无法提供加密,但是能很好的支持非ip流量和广播!

GRE over IPSec(使用IPsec来加密隧道进行传输)
    GRE OVER IPSEC 是 gre 做内层封装, ipsec 做外层封装,ipsec 感兴趣数据流为 gre源目地址,适用于两点都是固定 ip 或者一方是动态 IP 或内网环境,由于 ipsec 不能传广播和组播,gre 可以,这种环境还可以运行一些适用组播和广播的协议。

IPSec over GRE(加密数据流后从隧道传输)
    IPSEC OVER GRE 是 IPSEC 做内层封装,GRE 做外层封装,适用于两端路由器都是固定IP,ipsec 策略应用在物理口,ipsec 感兴趣数据流为业务网段,只对业务数据进行加密。

配置
sysname FW1

配置感兴趣流,源目都是业务地址段
acl number 3000
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 10.191.10.0 0.0.0.255
acl number 3001
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 10.191.20.0 0.0.0.255

安全提议正常配置,保证两端的参数一致就ok
ipsec proposal 1
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256

ike proposal 1
encryption-algorithm aes-256
dh group14
authentication-algorithm sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256

对端地址值得注意,ips over gre的对端地址是隧道地址
ike peer fw2
pre-shared-key huawei@123
ike-proposal 1
remote-address 12.1.1.2 //对端隧道地址
ike peer fw3
pre-shared-key huawei@123
ike-proposal 1
remote-address 22.1.1.2 //对端隧道地址

点到多点的场景中创建两个ipsec策略
ipsec policy ips1 1 isakmp
security acl 3000
ike-peer fw2
proposal 1
ipsec policy ips2 1 isakmp
security acl 3001
ike-peer fw3
proposal 1

interface GigabitEthernet1/0/0
undo shutdown
ip address 192.168.1.254 255.255.255.0

interface GigabitEthernet1/0/1
undo shutdown
ip address 172.16.0.254 255.255.255.0

interface GigabitEthernet1/0/3
undo shutdown
ip address 100.1.12.1 255.255.255.252
service-manage ping permit

interface Tunnel0
ip address 12.1.1.1 255.255.255.252
tunnel-protocol gre
keepalive
source GigabitEthernet1/0/3 //指定原接口
destination 100.1.12.6 //指定对端地址
ipsec policy ips1 //调用ipsec

interface Tunnel1
ip address 22.1.1.1 255.255.255.252
tunnel-protocol gre
keepalive
source GigabitEthernet1/0/3
destination 100.1.12.10
ipsec policy ips2

firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface GigabitEthernet1/0/1
add interface Tunnel0 //隧道接口要加入安全域,加入到非信任也可以
add interface Tunnel1

firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/3

ip route-static 0.0.0.0 0.0.0.0 100.1.12.2
ip route-static 10.191.10.0 255.255.255.0 Tunnel0 //去往对端私网的路由指向隧道口
ip route-static 10.191.20.0 255.255.255.0 Tunnel1

security-policy
rule name t-un //防火墙繁琐之处,私网到私网的流量一定要设置正反向
source-zone trust
destination-zone untrust
source-address 192.168.1.0 mask 255.255.255.0
destination-address 10.191.10.0 mask 255.255.255.0
destination-address 10.191.20.0 mask 255.255.255.0
action permit
rule name un-t
source-zone untrust
destination-zone trust
source-address 10.191.10.0 mask 255.255.255.0
source-address 10.191.20.0 mask 255.255.255.0
destination-address 192.168.1.0 mask 255.255.255.0
action permit
rule name ipsce //如果隧道口放非信任区,就省去了两个命令,local-unt就都包含了
source-zone local
source-zone trust
source-zone untrust
destination-zone local
destination-zone trust
destination-zone untrust
action permit
rule name to-isp //放行nat的流量
source-zone trust
destination-zone untrust
source-address 192.168.1.0 mask 255.255.255.0
action permit

nat-policy
rule name no-ips //无论防火墙还是路由器,在nat中一定要先把隧道的流量禁止
source-zone trust
destination-zone untrust
source-address 192.168.1.0 mask 255.255.255.0
destination-address 10.191.10.0 mask 255.255.255.0
destination-address 10.191.20.0 mask 255.255.255.0
action no-nat
rule name to-isp
source-zone trust
destination-zone untrust
source-address 192.168.1.0 mask 255.255.255.0
action source-nat easy-ip

sysname FW2

acl number 3000
rule 5 permit ip source 10.191.10.0 0.0.0.255 destination 192.168.1.0 0.0.0.255

ipsec proposal 1
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256
ike proposal 1
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 fw1
pre-shared-key huawei@123
ike-proposal 1
remote-address 12.1.1.1

ipsec policy ips 1 isakmp
security acl 3000
ike-peer fw1
proposal 1

interface GigabitEthernet0/0/0
undo shutdown
ip binding vpn-instance default
ip address 192.168.0.1 255.255.255.0
alias GE0/METH

interface GigabitEthernet1/0/0
undo shutdown
ip address 10.191.10.254 255.255.255.0

interface GigabitEthernet1/0/3
undo shutdown
ip address 100.1.12.6 255.255.255.252
service-manage ping permit

interface Tunnel0
ip address 12.1.1.2 255.255.255.252
tunnel-protocol gre
keepalive
source GigabitEthernet1/0/3
destination 100.1.12.1
ipsec policy ips

firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface Tunnel0

firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/3

firewall zone dmz
set priority 50

ip route-static 0.0.0.0 0.0.0.0 100.1.12.5
ip route-static 192.168.1.0 255.255.255.0 Tunnel0

security-policy
rule name t-un
source-zone trust
destination-zone untrust
source-address 10.191.10.0 mask 255.255.255.0
destination-address 192.168.1.0 mask 255.255.255.0
action permit
rule name un-t
source-zone untrust
destination-zone trust
source-address 192.168.1.0 mask 255.255.255.0
destination-address 10.191.10.0 mask 255.255.255.0
action permit
rule name ipsce
source-zone local
source-zone trust
source-zone untrust
destination-zone local
destination-zone trust
destination-zone untrust
action permit
rule name to-isp
source-zone trust
destination-zone untrust
source-address 10.191.10.0 mask 255.255.255.0
action permit

nat-policy
rule name t-un
source-zone trust
destination-zone untrust
source-address 10.191.10.0 mask 255.255.255.0
destination-address 192.168.1.0 mask 255.255.255.0
action no-nat
rule name to-isp
source-zone trust
destination-zone untrust
source-address 10.191.10.0 mask 255.255.255.0
action source-nat easy-ip

sysname FW3

acl number 3000
rule 5 permit ip source 10.191.20.0 0.0.0.255 destination 192.168.1.0 0.0.0.255

ipsec proposal 1
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256

ike proposal 1
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 fw1
pre-shared-key huawei@123
ike-proposal 1
remote-address 22.1.1.1

ipsec policy ips 1 isakmp
security acl 3000
ike-peer fw1
proposal 1

interface GigabitEthernet1/0/0
undo shutdown
ip address 10.191.20.254 255.255.255.0

interface GigabitEthernet1/0/3
undo shutdown
ip address 100.1.12.10 255.255.255.252
service-manage ping permit

interface Tunnel0
ip address 22.1.1.2 255.255.255.252
tunnel-protocol gre
keepalive
source GigabitEthernet1/0/3
destination 100.1.12.1
ipsec policy ips

firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface Tunnel0

firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/3

firewall zone dmz
set priority 50

ip route-static 0.0.0.0 0.0.0.0 100.1.12.9
ip route-static 192.168.1.0 255.255.255.0 Tunnel0

security-policy
rule name t-un
source-zone trust
destination-zone untrust
source-address 10.191.20.0 mask 255.255.255.0
destination-address 192.168.1.0 mask 255.255.255.0
action permit
rule name un-t
source-zone untrust
destination-zone trust
source-address 192.168.1.0 mask 255.255.255.0
destination-address 10.191.20.0 mask 255.255.255.0
action permit
rule name ipsce
source-zone local
source-zone trust
source-zone untrust
destination-zone local
destination-zone trust
destination-zone untrust
action permit
rule name to-isp
source-zone trust
destination-zone untrust
source-address 10.191.20.0 mask 255.255.255.0
action permit

nat-policy
rule name t-un
source-zone trust
destination-zone untrust
source-address 10.191.20.0 mask 255.255.255.0
destination-address 192.168.1.0 mask 255.255.255.0
action no-nat
rule name to-isp
source-zone trust
destination-zone untrust
source-address 10.191.20.0 mask 255.255.255.0
action source-nat easy-ip

​如果是点到点,总部配置删除一组即可

验证
模拟器开始会丢一部分包
在这里插入图片描述
验证ike sa
在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
华为防火墙与华三防火墙之间的IPSec对接,是指通过IPSec协议实现两个防火墙之间的安全通信和数据传输。下面是一个简单的说明步骤: 1. 配置华为防火墙:首先,在华为防火墙配置与华三防火墙对接的IPSec通道。配置包括选择合适的IPSec策略、安全参数和加密算法等,确保与对端的配置一致。 2. 配置华三防火墙:在华三防火墙上同样配置华为防火墙对接的IPSec通道,确保配置参数与华为防火墙相匹配。 3. 建立IPSec连接:在配置完成后,华为防火墙和华三防火墙会自动尝试建立IPSec连接。在此过程中,会进行握手协商、密钥交换等安全认证步骤,确保连接的安全性。 4. 验证连接:在建立连接后,需要验证IPSec连接是否成功。可以通过查看连接状态、查看日志等方式进行验证。 5. 配置安全策略和访问控制:建立了IPSec连接后,可以根据实际需求配置安全策略和访问控制,确保通过该连接的数据传输符合安全要求。 需要注意的是,IPSec连接的建立需要确保两端的配置一致,包括加密算法、认证方法、密钥长度等,否则将无法建立可靠的连接。同时,还需要保证防火墙的固件版本和硬件性能满足IPSec对接的要求。 通过IPSec对接,华为防火墙和华三防火墙可以实现安全可靠的通信和数据传输,提高网络的安全性和稳定性,确保企业的信息安全。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值