• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

H3C防火墙IPSec配置完成后,两地不通

2022-01-07提问
  • 1关注
  • 1收藏,2163浏览
粉丝:0人 关注:0人

问题描述:

A防火墙配置 IPSec

 

#匹配兴趣流

acl advanced name IPsec_shanghai_IPv4_1

 rule 0 permit ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255

 

# 创建ike密钥

ike keychain shanghai_IPv4_1

 match local address GigabitEthernet1/0/7

 pre-shared-key address B公网IP 255.255.255.128 key simple qwer

 

# 创建ike-id

 ike identity address A公网IP

 

# ike proposal 安全提议

ike proposal 1

 encryption-algorithm 3des-cbc

 authentication-algorithm md5

 

# 创建ike profile描述

ike profile shanghai_IPv4_1

 keychain shanghai_IPv4_1

 local-identity address A公网IP

 match remote identity address B公网IP 255.255.255.128

 match local address GigabitEthernet1/0/7

 proposal 1

 

# 创建IPSec安全提议加密算法/认证算法

ipsec transform-set shanghai_IPv4_1

 esp encryption-algorithm 3des-cbc

 esp authentication-algorithm md5

 pfs dh-group1

 

#配置IPSec策略

ipsec policy shanghai 1 isakmp

 transform-set shanghai_IPv4_1

 security acl name IPsec_shanghai_IPv4_1

 local-address A公网IP

 remote-address B公网IP

 ike-profile shanghai_IPv4_1

 sa trigger-mode auto

 

#在端口上运行ipsec策略

interface GigabitEthernet1/0/7

ipsec apply policy shanghai

 

---------------------

<firewall>dis acl all

Basic IPv4 ACL 2000, 1 rule,

ACL's step is 5

 rule 0 permit

 

Advanced IPv4 ACL 3000, 1 rule,

ACL's step is 5

 rule 0 permit ip (12833937 times matched)

 

Advanced IPv4 ACL named IPsec_shanghai_IPv4_1, 1 rule,

ACL's step is 5

 rule 0 permit ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255

 

 

<firewall>dis ike  sa

    Connection-ID   Remote                Flag         DOI

------------------------------------------------------------------

    10              B公网IP        RD           IPsec

Flags:

RD--READY RL--REPLACED FD-FADING RK-REKEY

 

<firewall>display ipsec sa

-------------------------------

Interface: GigabitEthernet1/0/7

-------------------------------

 

  -----------------------------

  IPsec policy: shanghai

  Sequence number: 1

  Mode: ISAKMP

  -----------------------------

    Tunnel id: 0

    Encapsulation mode: tunnel

    Perfect Forward Secrecy: dh-group1

    Inside VPN:

    Extended Sequence Numbers enable: N

    Traffic Flow Confidentiality enable: N

    Path MTU: 1444

    Tunnel:

        local  address: A公网IP

        remote address: B公网IP

    Flow:

        sour addr: 100.86.226.0/255.255.255.0  port: 0  protocol: ip

        dest addr: 100.86.10.0/255.255.255.0  port: 0  protocol: ip

 

    [Inbound ESP SAs]

      SPI: 1523471462 (0x5ace5466)

      Connection ID: 1095216660480

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/787

      Max received sequence-number: 0

      Anti-replay check enable: Y

      Anti-replay window size: 64

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

    [Outbound ESP SAs]

      SPI: 1786696126 (0x6a7ed1be)

      Connection ID: 4342211936257

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/787

      Max sent sequence-number: 0

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

  -----------------------------

  IPsec policy: shanghai

  Sequence number: 1

  Mode: ISAKMP

  -----------------------------

    Tunnel id: 0

    Encapsulation mode: tunnel

    Perfect Forward Secrecy: dh-group1

    Inside VPN:

    Extended Sequence Numbers enable: N

    Traffic Flow Confidentiality enable: N

    Path MTU: 1444

    Tunnel:

        local  address: A公网IP

        remote address: B公网IP

    Flow:

        sour addr: 100.86.226.0/255.255.255.0  port: 0  protocol: ip

        dest addr: 100.86.10.0/255.255.255.0  port: 0  protocol: ip

 

    [Inbound ESP SAs]

      SPI: 3519410599 (0xd1c5f1a7)

      Connection ID: 38654705666

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/3488

      Max received sequence-number: 0

      Anti-replay check enable: Y

      Anti-replay window size: 64

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

    [Outbound ESP SAs]

      SPI: 2590343634 (0x9a6581d2)

      Connection ID: 1730871820291

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/3488

      Max sent sequence-number: 0

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

 

 

 

 

B防火墙配置 IPSec

#匹配兴趣流

acl advanced name IPsec_wuhu_IPv4_1

rule 0 permit ip source 100.86.10.0 0.0.0.255 destination 100.86.226.0 0.0.0.255

 

# 创建ike密钥

ike keychain wuhu_IPv4_1

 match local address GigabitEthernet1/0/6

 pre-shared-key address A公网IP 255.255.255.252 key simple qwer

 

#创建ike-id

 ike identity address B公网IP

 

# ike proposal 安全提议

ike proposal 1

 encryption-algorithm 3des-cbc

 authentication-algorithm md5

 

# 创建ike profile描述

ike profile wuhu_IPv4_1

 keychain wuhu_IPv4_1

 local-identity address B公网IP

 match remote identity address A公网IP 255.255.255.252

 match local address GigabitEthernet1/0/6

 proposal 1   

 

# 创建IPSec安全提议加密算法/认证算法

ipsec transform-set wuhu_IPv4_1

 esp encryption-algorithm 3des-cbc

 esp authentication-algorithm md5

 pfs dh-group1

 

#配置IPSec策略

ipsec policy wuhu 1 isakmp

 transform-set wuhu_IPv4_1

 security acl name IPsec_wuhu_IPv4_1

 local-address B公网IP

 remote-address A公网IP

 ike-profile wuhu_IPv4_1

 sa trigger-mode auto

 

#在端口上运行ipsec策略

interface g1/0/6

 ipsec apply policy wuhu

 

--------------------------------------

<firewall>dis acl all

Basic IPv4 ACL 2000, 1 rule,

ACL's step is 5

 rule 0 permit

 

Advanced IPv4 ACL 3000, 2 rules,

ACL's step is 5

 rule 0 permit ip (115 times matched)

 rule 5 permit ip source 100.86.10.0 0.0.0.255

 

Advanced IPv4 ACL named IPsec_wuhu_IPv4_1, 1 rule,

ACL's step is 5

 rule 0 permit ip source 100.86.10.0 0.0.0.255 destination 100.86.226.0 0.0.0.255

 

<firewall>dis ike  sa

    Connection-ID   Remote                Flag         DOI    

------------------------------------------------------------------

    30              A公网IP       RD           IPsec  

Flags:

RD--READY RL--REPLACED FD-FADING RK-REKEY

 

<firewall>display ipsec sa

-------------------------------

Interface: GigabitEthernet1/0/6

-------------------------------

 

  -----------------------------

  IPsec policy: wuhu

  Sequence number: 1

  Mode: ISAKMP

  -----------------------------

    Tunnel id: 0

    Encapsulation mode: tunnel

    Perfect Forward Secrecy: dh-group1

    Inside VPN:

    Extended Sequence Numbers enable: N

    Traffic Flow Confidentiality enable: N

    Path MTU: 1444

    Tunnel:

        local  address: B公网IP

        remote address: A公网IP

    Flow:

        sour addr: 100.86.10.0/255.255.255.0  port: 0  protocol: ip

        dest addr: 100.86.226.0/255.255.255.0  port: 0  protocol: ip

 

    [Inbound ESP SAs]

      SPI: 1786696126 (0x6a7ed1be)

      Connection ID: 1249835483137

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/733

      Max received sequence-number: 0

      Anti-replay check enable: Y

      Anti-replay window size: 64

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

    [Outbound ESP SAs]

      SPI: 1523471462 (0x5ace5466)

      Connection ID: 3431678869504

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/733

      Max sent sequence-number: 0

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

  -----------------------------

  IPsec policy: wuhu

  Sequence number: 1

  Mode: ISAKMP

  -----------------------------

    Tunnel id: 0

    Encapsulation mode: tunnel

    Perfect Forward Secrecy: dh-group1

    Inside VPN:

    Extended Sequence Numbers enable: N

    Traffic Flow Confidentiality enable: N

    Path MTU: 1444

    Tunnel:

        local  address: B公网IP

        remote address: A公网IP

    Flow:

        sour addr: 100.86.10.0/255.255.255.0  port: 0  protocol: ip

        dest addr: 100.86.226.0/255.255.255.0  port: 0  protocol: ip

 

    [Inbound ESP SAs]

      SPI: 2590343634 (0x9a6581d2)

      Connection ID: 1181116006403

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/3434

      Max received sequence-number: 0

      Anti-replay check enable: Y

      Anti-replay window size: 64

      UDP encapsulation used for NAT traversal: N

      Status: Active

 

    [Outbound ESP SAs]

      SPI: 3519410599 (0xd1c5f1a7)

      Connection ID: 571230650370

      Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5

      SA duration (kilobytes/sec): 1843200/3600

      SA remaining duration (kilobytes/sec): 1843200/3434

      Max sent sequence-number: 0

      UDP encapsulation used for NAT traversal: N

      Status: Active






最佳答案

已采纳
白熊 三段
粉丝:2人 关注:3人

公网接口内网兴趣流地址做了deny了么,就是就不走nat,要加个acl

回复白熊:

A端 # acl advanced 3888 rule 10 deny ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255 rule 100 permit ip # B端 # acl advanced 3888 rule 10 deny ip source 100.86.10.0 0.0.0.255 destination 100.86.226.0 0.0.0.255 rule 100 permit ip # 大佬,这样正确吗?

zhiliao_a4ekWK 发表时间:2022-01-10 更多>>

具体是什么样的?

zhiliao_a4ekWK 发表时间:2022-01-07

你ip上网不是公网接口做了个natoutbound ,这个要在permit any 前面加一条,deny 本端地址,对端地址,和你的感兴趣流一样,为的是让ipsec流量走nat出去了

白熊 发表时间:2022-01-07
回复白熊:

少打个字,是不让走nat出去,因为数据匹配原则是先匹配nat,后ipsec,你看下手册案例,上面有

白熊 发表时间:2022-01-07

acl advanced 3888 rule 0 deny ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255 nat outbound 3888 是这样吗?

zhiliao_a4ekWK 发表时间:2022-01-07

对,最后面要加个petmit any 要不你其它上不上网

白熊 发表时间:2022-01-07

另一个防火墙的出口也是,deny是反过来,和感兴趣流一样

白熊 发表时间:2022-01-07

interface GigabitEthernet1/0/7 port link-mode route bandwidth 100000 ip address 公网IP 255.255.255.252 nat outbound 3888 ipsec apply policy shanghai gateway ****

zhiliao_a4ekWK 发表时间:2022-01-07

[firewall]display acl all Basic IPv4 ACL 2000, 1 rule, ACL's step is 5 rule 0 permit Advanced IPv4 ACL 3000, 1 rule, ACL's step is 5 rule 0 permit ip (12833937 times matched) Advanced IPv4 ACL 3888, 1 rule, ACL's step is 5 rule 0 permit ip (48348 times matched) Advanced IPv4 ACL named IPsec_shanghai_IPv4_1, 1 rule, ACL's step is 5 rule 0 permit ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255

zhiliao_a4ekWK 发表时间:2022-01-07

还是不行

zhiliao_a4ekWK 发表时间:2022-01-07

你3888做错了呀,你前面发的rule 0 deny 去哪了?

白熊 发表时间:2022-01-07

我手机不好打那么多, acl ad 3888 rule 10 deny ip sou 本地私网 de 对端私网 rule 100 permit any

白熊 发表时间:2022-01-07
回复白熊:

A端 # acl advanced 3888 rule 10 deny ip source 100.86.226.0 0.0.0.255 destination 100.86.10.0 0.0.0.255 rule 100 permit ip # B端 # acl advanced 3888 rule 10 deny ip source 100.86.10.0 0.0.0.255 destination 100.86.226.0 0.0.0.255 rule 100 permit ip # 大佬,这样正确吗?

zhiliao_a4ekWK 发表时间:2022-01-10
2 个回答
粉丝:97人 关注:1人

策略放行了没有

粉丝:20人 关注:2人

防火墙放通相关数据流

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明