<abbr id="ysm8o"></abbr>
  • <button id="ysm8o"></button>
  • <source id="ysm8o"></source>
  • <cite id="ysm8o"></cite>
    <button id="ysm8o"></button>
  • <samp id="ysm8o"></samp>
    | EN021-62279227發(fā)送郵件
    在線QQ咨詢
    • 上海普用--周班長
    • 上海普用--老王
    • 上海普用--阿胖

    021-62279227

    在線留言

    技術(shù)資料|Technical trainings

    首頁 > 新聞中心 > 技術(shù)資料

    HUAWEI篇 NGFW以策略方式與AR建立IPSec隧道

    Admin2017-02-24 10:42:35

    組網(wǎng)需求

    1-1所示總部和分支網(wǎng)關(guān)分別通過NGFWAR設(shè)備接入Internet現(xiàn)企業(yè)需要在NGFWAR之間建立IPSec隧道實現(xiàn)分支和總部內(nèi)網(wǎng)互通。

    圖1-1 NGFW以策略方式與AR建立IPSec隧道

    20170220112115314001.png

     

    配置項

    NGFW

    AR

    設(shè)備信息

    l  設(shè)備型號USG6330

    l  軟件版本V100R001C30

    l  設(shè)備型號AR2220

    l  軟件版本V200R005C20

    IPSec策略建立方式

    策略方式

    策略方式

    IPSec安全提議

    封裝模式

    隧道模式

    隧道模式

    安全協(xié)議

    ESP

    ESP

    ESP協(xié)議驗證算法

    SHA2-256

    SHA2-256

    ESP協(xié)議加密算法

    AES-128

    AES-128

    DH Group

    GROUP2

    GROUP2

    IKE對等體

    協(xié)商模式

    主模式

    主模式

    加密算法

    AES-128

    AES-128

    認證算法

    SHA2-256

    SHA2-256

    預(yù)共享密鑰

    Key123

    Key123

    身份類型

    IP地址

    IP地址

    版本

    V1

    V1

     

    操作步驟

                                    步驟 1     配置NGFW

    1.         配置接口IP地址并將接口加入安全區(qū)域。

    [NGFW] interface GigabitEthernet 1/0/1 
    [NGFW-GigabitEthernet1/0/1] ip address 10.1.1.1 24 
    [NGFW-GigabitEthernet1/0/1] quit 
    [NGFW] interface GigabitEthernet 1/0/2 
    [NGFW-GigabitEthernet1/0/2] ip address 1.1.3.1 24 
    [NGFW-GigabitEthernet1/0/2] quit 
    [NGFW] firewall zone trust 
    [NGFW-zone-trust] add interface GigabitEthernet 1/0/1 
    [NGFW-zone-trust] quit 
    [NGFW] firewall zone untrust 
    [NGFW-zone-untrust] add interface GigabitEthernet 1/0/2 
    [NGFW-zone-untrust] quit

    2.         配置NGFWInternet的缺省路由假設(shè)下一跳為1.1.3.2。

    [NGFW] ip route-static 0.0.0.0 0.0.0.0 1.1.3.2

    3.         配置域間安全策略。

    a.         配置Trust域與Untrust域的安全策略允許IPSec封裝前和解封裝后的原始報文能通過NGFW

    [NGFW] security-policy 
    [NGFW-policy-security] rule name 1 
    [NGFW-policy-security-rule-1] source-zone untrust 
    [NGFW-policy-security-rule-1] destination-zone trust 
    [NGFW-policy-security-rule-1] source-address 10.1.3.0 24 
    [NGFW-policy-security-rule-1] destination-address 10.1.1.0 24 
    [NGFW-policy-security-rule-1] action permit 
    [NGFW-policy-security-rule-1] quit 
    [NGFW-policy-security] rule name 2 
    [NGFW-policy-security-rule-2] source-zone trust 
    [NGFW-policy-security-rule-2] destination-zone untrust 
    [NGFW-policy-security-rule-2] source-address 10.1.1.0 24 
    [NGFW-policy-security-rule-2] destination-address 10.1.3.0 24 
    [NGFW-policy-security-rule-2] action permit 
    [NGFW-policy-security-rule-2] quit

    b.         配置Local域與Untrust域的安全策略允許IKE協(xié)商報文能正常通過NGFW。

    [NGFW-policy-security] rule name 3 
    [NGFW-policy-security-rule-3] source-zone local 
    [NGFW-policy-security-rule-3] destination-zone untrust 
    [NGFW-policy-security-rule-3] source-address 1.1.3.1 32 
    [NGFW-policy-security-rule-3] destination-address 1.1.5.1 32 
    [NGFW-policy-security-rule-3] action permit 
    [NGFW-policy-security-rule-3] quit 
    [NGFW-policy-security] rule name 4 
    [NGFW-policy-security-rule-4] source-zone untrust 
    [NGFW-policy-security-rule-4] destination-zone local 
    [NGFW-policy-security-rule-4] source-address 1.1.5.1 32 
    [NGFW-policy-security-rule-4] destination-address 1.1.3.1 32 
    [NGFW-policy-security-rule-4] action permit 
    [NGFW-policy-security-rule-4] quit

    4.         配置IPSec策略。

    a.         配置訪問控制列表定義需要保護的數(shù)據(jù)流。

    [NGFW] acl 3000 
    [NGFW-acl-adv-3000] rule permit ip source 10.1.1.0 0.0.0.255 destination 10.1.3.0 0.0.0.255 
    [NGFW-acl-adv-3000] quit

    b.         配置IPSec安全提議。

    [NGFW] ipsec proposal tran1 
    [NGFW-ipsec-proposal-tran1] transform esp 
    [NGFW-ipsec-proposal-tran1] encapsulation-mode tunnel 
    [NGFW-ipsec-proposal-tran1] esp authentication-algorithm sha2-256 
    [NGFW-ipsec-proposal-tran1] esp encryption-algorithm aes-128 
    [NGFW-ipsec-proposal-tran1] quit

    c.         創(chuàng)建IKE安全提議。

    [NGFW] ike proposal 1 
    [NGFW-ike-proposal-1] encryption-algorithm aes-128 
    [NGFW-ike-proposal-1] authentication-algorithm sha2-256 
    [NGFW-ike-proposal-1] dh group2 
    [NGFW-ike-proposal-1] quit

    d.         配置IKE對等體。

    [NGFW] ike peer ar 
    [NGFW-ike-peer-ar] undo version 2 
    [NGFW-ike-peer-ar] exchange-mode main 
    [NGFW-ike-peer-ar] ike-proposal 1 
    [NGFW-ike-peer-ar] pre-shared-key Key123 
    [NGFW-ike-peer-ar] remote-address 1.1.5.1 
    [NGFW-ike-peer-ar] quit

    e.         配置isakmp方式的IPSec策略。

    [NGFW] ipsec policy map1 1 isakmp 
    [NGFW-ipsec-policy-isakmp-map1-1] ike-peer ar 
    [NGFW-ipsec-policy-isakmp-map1-1] proposal tran1 
    [NGFW-ipsec-policy-isakmp-map1-1] security acl 3000 
    [NGFW-ipsec-policy-isakmp-map1-1] quit

    f.          在接口GigabitEthernet 1/0/2上應(yīng)用IPSec策略。

    [NGFW] interface GigabitEthernet 1/0/2 
    [NGFW-GigabitEthernet1/0/2] ipsec policy map1 
    [NGFW-GigabitEthernet1/0/2] quit

                                    步驟 2     配置AR設(shè)備。

    1.         配置AR接口的IP地址。

    <Huawei> system-view 
    [Huawei] sysname AR 
    [AR] interface GigabitEthernet 0/0/1 
    [AR-GigabitEthernet0/0/1] ip address 10.1.3.1 24 
    [AR-GigabitEthernet0/0/1] quit 
    [AR] interface GigabitEthernet 0/0/2 
    [AR-GigabitEthernet0/0/2] ip address 1.1.5.1 24 
    [AR-GigabitEthernet0/0/2] quit

    2.         配置AR連接到Internet的缺省路由假設(shè)下一跳地址為1.1.5.2。

    [AR] ip route-static 0.0.0.0 0.0.0.0 1.1.5.2

    3.         配置IPSec策略。

    a.         配置訪問控制列表定義需要保護的數(shù)據(jù)流。

    [AR] acl 3000 
    [AR-acl-adv-3000] rule permit ip source 10.1.3.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 
    [AR-acl-adv-3000] quit

    b.         配置IPSec安全提議。

    [AR] ipsec proposal tran1 
    [AR-ipsec-proposal-tran1] transform esp 
    [AR-ipsec-proposal-tran1] encapsulation-mode tunnel 
    [AR-ipsec-proposal-tran1] esp authentication-algorithm sha2-256 
    [AR-ipsec-proposal-tran1] esp encryption-algorithm aes-128 
    [AR-ipsec-proposal-tran1] quit

    c.         創(chuàng)建IKE安全提議。

    [AR] ike proposal 1 
    [AR-ike-proposal-1] encryption-algorithm aes-cbc-128 
    [AR-ike-proposal-1] authentication-algorithm sha2-256 
    [AR-ike-proposal-1] dh group2 
    [AR-ike-proposal-1] quit

    d.         配置IKE對等體。

    [AR] ike peer ngfw v1  /*參數(shù)v1表示IKE使用v1版本進行IKE協(xié)商。
    [AR-ike-peer-ngfw] exchange-mode main 
    [AR-ike-peer-ngfw] ike-proposal 1 
    [AR-ike-peer-ngfw] pre-shared-key cipher Key123 
    [AR-ike-peer-ngfw] remote-address 1.1.3.1 
    [AR-ike-peer-ngfw] quit

    e.         配置isakmp方式的IPSec策略。

    [AR] ipsec policy map1 1 isakmp 
    [AR-ipsec-policy-isakmp-map1-1] ike-peer ngfw 
    [AR-ipsec-policy-isakmp-map1-1] proposal tran1 
    [AR-ipsec-policy-isakmp-map1-1] security acl 3000 
    [AR-ipsec-policy-isakmp-map1-1] quit

    f.          在接口GigabitEthernet 0/0/2上應(yīng)用IPSec策略。

    [AR] interface GigabitEthernet 0/0/2 
    [AR-GigabitEthernet0/0/2] ipsec policy map1 
    [AR-GigabitEthernet0/0/2] quit

    ----結(jié)束

    結(jié)果驗證

    1.         配置完成后使用分支下的用戶Ping總部下的用戶。

    2.         正常情況下分支訪問總部的數(shù)據(jù)流將會觸發(fā)兩臺網(wǎng)關(guān)之間建立IPSec隧道。此處在NGFW上查看IKE SA的建立情況可以看到IKE SA已經(jīng)建立成功。

    <NGFW> display ike sa 
    15:53:30  2015/12/26            
    current ike sa number: 2        
    --------------------------------------------------------------------------------
    ------------------              
    conn-id    peer    flag          phase vpn       
    --------------------------------------------------------------------------------
    ------------------              
    179        1.1.5.1 RD|ST|A       v1:2  public    
    178        1.1.5.1 RD|ST|D|A     v1:1  public    
      
      
      flag meaning                  
      RD--READY      ST--STAYALIVE     RL--REPLACED    FD--FADING    TO--TIMEOUT    
      TD--DELETING   NEG--NEGOTIATING  D--DPD          M--ACTIVE     S--STANDBY     
      A--ALONE                   

    3.         使用display ipsec sa命令查看IPSec的建立情況可以看到IPSec SA也已建立成功。

    <NGFW> display ipsec sa 
    15:53:53  2015/12/26            
    =============================== 
    Interface: GigabitEthernet1/0/2 
        path MTU: 1500              
    =============================== 
      
      ----------------------------- 
      IPsec policy name: "map1"     
      sequence number: 1            
      mode: isakmp                  
      vpn: public                   
      ----------------------------- 
        connection id: 179          
        rule number: 5              
        encapsulation mode: tunnel  
        holding time: 0d 0h 1m 53s  
        tunnel local : 1.1.3.1    tunnel remote: 1.1.5.1 
        flow      source: 10.1.1.0/255.255.255.0 0/0 
        flow destination: 10.1.3.0/255.255.255.0 0/0 
      
        [inbound ESP SAs]           
          spi: 112877185 (0x6ba5e81)                 
          vpn: public  said: 36  cpuid: 0x0000       
          proposal: ESP-ENCRYPT-AES ESP-AUTH-SHA2-256  
          sa remaining key duration (kilobytes/sec): 1843199/3487 
          max received sequence-number: 17           
          udp encapsulation used for nat traversal: N  
      
        [outbound ESP SAs]          
          spi: 1572321462 (0x5db7b8b6)               
          vpn: public  said: 37  cpuid: 0x0000       
          proposal: ESP-ENCRYPT-AES ESP-AUTH-SHA2-256  
          sa remaining key duration (kilobytes/sec): 1843199/3487  
          max sent sequence-number: 18               
          udp encapsulation used for nat traversal: N  

    雖然隧道建立成功了但是我們?nèi)绾闻袛鄻I(yè)務(wù)流量是經(jīng)過IPSec隧道傳輸呢這個驗證辦法有多種這里強叔介紹其中兩種辦法供大家參考。

    l   方法1查看display ipsec sa命令回顯信息中max sent sequence-number字段的值。這個字段原本是為防重放功能設(shè)計的設(shè)備的IPSec隧道每發(fā)出一個報文這里的sequence-number就相應(yīng)加1。這樣一來我們就可以利用該字段值的變化來判斷流量是否經(jīng)過這條IPSec隧道傳輸了。例如分支用戶向總部用戶發(fā)送了5ICMP報文如果這5ICMP報文是經(jīng)過這條IPSec隧道傳輸?shù)哪敲磳?yīng)這條隧道的IPSec SAsequence-number的值將會增加5。反之如果這里sequence-number的值沒有增長或者增長數(shù)目不對則說明這些報文沒有經(jīng)過這條IPSec隧道傳輸或者是這條IPSec隧道有異常。

    l   方法2查看display ipsec statistics的統(tǒng)計信息。通過此命令中input/output security packets字段值的變化也可以查看報文是否經(jīng)過IPSec隧道傳輸。例如下面input/output security packets字段表明IPSec隧道發(fā)出去了3個報文也收到了3個報文。

    <NGFW> display ipsec statistics 
    15:54:21  2015/12/26            
      the security packet statistics: 
        input/output security packets: 3/3   
        input/output security bytes: 252/252         
        input/output dropped security packets: 0/0   
        the encrypt packet statistics                
          send sae:3, recv sae:3, send err:0         
          local cpu:3, other cpu:0, recv other cpu:0 
          intact packet:2, first slice:0, after slice:0 
        the decrypt packet statistics                
          send sae:3, recv sae:3, send err:0         
          local cpu:0, other cpu:0, recv other cpu:0 
          reass  first slice:0, after slice:0, len err:0 
    ....

    20170220112116840002.jpg

    觸發(fā)建立IPSec隧道的首個業(yè)務(wù)報文不會進入隧道封裝會被丟棄掉。這是因為首包發(fā)出時隧道還未建立無法進行轉(zhuǎn)發(fā)。例如分支用戶向總部用戶發(fā)送了10ICMP報文實際使用display ipsec statistics命令查看時統(tǒng)計信息中可能顯示只有9個報文這屬于正常情況。

    這兩種方法雖然都可以查看隧道中報文的變化但是第一種方法可以觀察到指定隧道的報文變化而第二種方法是全局性的統(tǒng)計信息觀察的是整個設(shè)備的IPSec隧道報文變化。如果設(shè)備同時存在多條隧道則第二種方法就不太適用了所以推薦使用第一種辦法查看。

    IPSec隧道故障定位辦法

    對于初次搭建IPSec隧道的小伙伴來講如果能一次性搭建成功那就是萬事大吉。然而現(xiàn)實并非如此由于IPSec的配置參數(shù)和步驟較多遇到配置完成但隧道建立不起來的情況也是常有的事。那如何定位故障的發(fā)生位置呢這里強叔就給大家介紹一下使用Debugging命令快速定位問題的辦法。

    1.         打開Debugging開關(guān)。

    <NGFW> terminal monitor 
    15:43:17  2015/12/26            
    Info: Current terminal monitor is on 
    <NGFW> terminal debugging  
    15:43:20  2015/12/26            
    Info: Current terminal debugging is on 
    <NGFW> debugging ike error 
    15:43:27  2015/12/26           

    這里需要注意開啟IKE調(diào)測開關(guān)的時候選擇ike表示針對v1版本的隧道協(xié)商進行調(diào)測選擇ikev2表示針對ikev2的隧道協(xié)商進行調(diào)測。我們需要根據(jù)實際隧道中配置的IKE版本來選取這里的參數(shù)。另外這里調(diào)測開關(guān)選擇error就可以了可以先不使用all參數(shù)這樣做的目的是防止設(shè)備打印IPSec調(diào)測信息較多產(chǎn)生干擾信息。

    2.         使用Ping命令觸發(fā)隧道協(xié)商觀察設(shè)備的調(diào)測信息。例如設(shè)備提示如下信息則表明問題發(fā)生在IKE協(xié)商的第一階段且原因是IKE的安全提議不匹配。這個時候就需要比對兩臺網(wǎng)關(guān)上的IKE提議確保安全提議一致才行。

    2015-12-26 15:47:03 NGFW %IKE/4/WARNING(l): phase1proposal mismatch, please check ike proposal configuration. 

    3.         使用Ping命令觸發(fā)隧道協(xié)商觀察設(shè)備的調(diào)測信息。如果設(shè)備提示如下信息則表明問題發(fā)生在IPSec協(xié)商的第二階段且原因是ACL不匹配。這個時候就需要比對兩臺網(wǎng)關(guān)上的ACL正確的配置是這里兩臺網(wǎng)關(guān)上的ACL必須是鏡像配置才行。

    2015-12-26 15:49:59 NGFW %IKE/4/WARNING(l): phase2security acl mismatch.


    關(guān)于我們 | 產(chǎn)品展示 | 在線留言 | 公司地址 | 網(wǎng)站地圖

    Copyright ? 2014 - 2018> 上海普用電子科技有限公司 版權(quán)所有 滬ICP備17005640號-2

    <abbr id="ysm8o"></abbr>
  • <button id="ysm8o"></button>
  • <source id="ysm8o"></source>
  • <cite id="ysm8o"></cite>
    <button id="ysm8o"></button>
  • <samp id="ysm8o"></samp>