Does the Interface with a Dynamic IP Address Support IPSec?
Yes.
When the local interface has a dynamic IP address and the peer interface has a fixed IP address, configure an IPSec policy template on the peer interface to implement IPSec.
The following uses the 3G interface as an example to implement IKE auto negotiation.
Dynamic IP address
# ike peer peer_3g_1 pre-shared-key cipher %@%@VsiNAx"H;$1jaO'QE%[=I\O6%@%@ //Set the pre-shared key to huawei. remote-address 10.5.39.160 //Specify a fixed IP address for the peer end. # ipsec proposal ipsec //Use the default security parameters. # ipsec policy ipsec 1 isakmp //Configure an IPSec policy and import the policy on a 3G interface. security acl 3000 ike-peer peer_3g_1 proposal ipsec # interface Cellular0/0/0 ipsec policy ipsec //Configure the IPSEC policy on the 3G interface. # acl 3000 //Configure ACL rules. The IPSec policy protects packets that match ACL rules. ... #
Fixed IP address
# ipsec proposal ipsec # ike peer peer_3g_2 //The peer end uses a dynamic IP address. pre-shared-key cipher %@%@VsiNAx"H;$1jaO'QE%[=I\O6%@%@ //Set the pre-shared key to huawei. # ipsec policy-template temp 1 //Configure an IPSec policy template. ike-peer peer_3g_2 proposal ipsec # ipsec policy ipsec 1 isakmp template temp //Configure an IPSec policy and bind the policy to the template. # interface GigabitEthernet 1/0/0 //This interface uses a fixed IP address. ipsec policy ipsec ip address 10.5.39.160 255.255.255.255 #
In V200R002C00 and earlier versions, run the pre-shared-key huawei command to set the pre-shared key to huawei.
In V200R008C00 and later versions, the v1 and v2 parameters are deleted from the ike peer peer-name [ v1 | v2 ] command. To configure the IKE protocol, run the version { 1 | 2 } command.