No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


Interoperation Configuration Guide

AR Router

This document provides cases for connecting AR enterprise routers to devices of other vendors.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Establishing an IPSec Tunnel Through Negotiation Initiated by the Branch Gateway (NAT Enabled on the Outbound Interface) to the Headquarters Cisco Router (Using the Host Name)

Example for Establishing an IPSec Tunnel Through Negotiation Initiated by the Branch Gateway (NAT Enabled on the Outbound Interface) to the Headquarters Cisco Router (Using the Host Name)


This example applies to all versions and routers.

Networking Requirements

As shown in Figure 5-1, RouterA is the enterprise branch gateway, NAT is deployed on the outbound interface of RouterA, and RouterB is the enterprise headquarters gateway (Cisco router). The branch and headquarters communicate through the public network.

The enterprise wants to protect data flows between the branch subnet and the headquarters subnet. Because the branch gateway dynamically obtains an IP address, the headquarters gateway can use the host name to establish an IPSec tunnel with the branch gateway.

IPSec and NAT are both configured on the outbound interface of the branch gateway, so traffic to be protected is processed by NAT and IPSec in sequence. You can add ACL rules used by NAT to deny traffic to be protected by IPSec so that the traffic is only encrypted by IPSec.

Figure 5-1  Networking for establishing an IPSec tunnel through negotiation initiated by the branch gateway with a dynamic IP address to the headquarters Cisco router


  1. Configure RouterA.

     sysname RouterA  //Configure the device name.
     ipsec authentication sha2 compatible enable
     ike local-name huawei
    acl number 3000  //Specify data flows (traffic from the branch subnet to the headquarters subnet) to be protected.
     rule 5 permit ip source destination
    acl number 3001  //Configure an ACL to deny data flows to be protected.
     rule 5 deny ip source destination
     rule 10 permit ip
    ipsec proposal prop1  //Configure an IPSec proposal.
     esp authentication-algorithm sha2-256
     esp encryption-algorithm aes-128
    ike proposal 1  //Configure an IKE proposal.
     encryption-algorithm aes-cbc-128   //In V200R008 and later versions, the aes-cbc-128 parameter is changed to aes-128.
     dh group14
     authentication-algorithm sha2-256
    ike peer peer1 v1  //The commands used to configure IKE peers and the IKE protocol differ depending on the software version. In earlier versions of V200R008, the command is ike peer peer-name [ v1 | v2 ]. In V200R008 and later versions, the command is ike peer peer-name and version { 1 | 2 }. By default, IKEv1 and IKEv2 are enabled simultaneously. An initiator uses IKEv2 to initiate a negotiation request, while a responder uses IKEv1 or IKEv2 to respond. To initiate a negotiation request using IKEv1, run the undo version 2 command.
     exchange-mode aggressive  //Configure the aggressive mode.
     pre-shared-key cipher %#%#@W4p8i~Mm5sn;9Xc&U#(cJC;.CE|qCD#jAH&/#nR%#%#  //Configure the pre-shared key as huawei@1234.
     ike-proposal 1
     local-id-type name   //Configure the local ID type for IKE negotiation. In V200R008 and later versions, the name parameter is changed to fqdn.
     remote-name RouterB   //Configure the IKE peer name. In V200R008 and later versions, the device does not support the remote-name command. This command provides teh same function as the remote-id command.
    ipsec policy policy1 10 isakmp  //Configure an IPSec policy.
     security acl 3000 
     ike-peer peer1
     proposal prop1
    interface GigabitEthernet0/0/1
     ipsec policy policy1     //Apply the IPSec policy to the interface.
     nat outbound 3001        //Configure NAT on the interface.
     ip address dhcp-alloc    //Enable the DHCP client function to allow the branch gateway to dynamically obtain an IP address. In addition, you also need to configure the DHCP 
                                server function on the device directly connected or having a reachable route to RouterA. For detailed configurations, see the product documentation
                                of the device used.
    interface GigabitEthernet0/0/2
     ip address

  2. Configure RouterB.

    hostname RouterB  //Configure the device name.
    crypto isakmp policy 1
     encryption aes 128
     hash sha256
     authentication pre-share
     group 14
    crypto isakmp key huawei@1234 hostname huawei  //Configure the pre-shared key as huawei@1234.
    crypto isakmp identity hostname   //Set the local ID type in IKE negotiation to hostname.
    crypto ipsec transform-set p1 esp-sha256-hmac esp-aes 128  //Configure a security algorithm used by IPSec.
    crypto dynamic-map p1 1  //Create a dynamic crypto map entry.
     set transform-set p1
     match address 102
    crypto map p1 1 ipsec-isakmp dynamic p1  //Configure an IPSec policy.
    interface GigabitEthernet0/0
     ip address
     duplex auto
     speed auto
     crypto map p1     //Apply the IPSec policy to the interface.
    interface GigabitEthernet0/1
     ip address
     duplex auto
     speed auto
    ip route  //Configure a static route to ensure reachability at both ends.
    access-list 102 permit ip //Specify data flows (traffic from the headquarters subnet to the branch subnet) to be protected.

  3. Verify the configuration.

    # After the configuration is complete, run the ping command on PC A. PC B can be pinged.

    # Run the display ike sa and display ipsec sa commands on RouterA, and run the show crypto isakmp sa and show crypto ipsec sa commands on RouterB. You can see that the IPSec tunnel is created successfully.

    # Run the display ipsec statistics command on RouterA to check data packet statistics.

Configuration Notes

In this example, the commands on the Cisco router are recommended ones. The product version is Cisco IOS Software, C3900e Software (C3900e-UNIVERSALK9-M), Version 15.2(4)M1, RELEASE SOFTWARE (fc1). For details, visit

MD5, SHA-1, DES, and 3DES have potential security risks. Exercise caution when you use them.

Updated: 2019-05-17

Document ID: EDOC1100034005

Views: 22748

Downloads: 450

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Previous Next