`VPC utilizes unique identifiers to manipulate the configuration of
a VPN Connection. Each VPN Connection is assigned an identifier and is
associated with Virtual Private Gateway Identifier and User Gateway IP.
Your VPN Connection ID : 37315 #用户本地防火墙IPsec连接的ID
Your Virtual Private Gateway ID : 23850 #用户本地防火墙VPN网关的ID
Your User Gateway IP : 180.XX.XX.137 #用户本地网关IP,对应控制台配置IPsec连接中的Remote ID
To configure an IKE-based IPsec tunnel, perform the following tasks:
#1: Internet Key Exchange (IKE) Configuration #IKE配置
A policy is established for the supported ISAKMP encryption,
authentication, Diffie-Hellman and key parameters.
An IKE proposal defines a set of attributes describing how IKE negotiation in
phase 1 should take place.
By default, there is an IKE proposal that is used as the default IKE proposal.
The default IKE proposal parameters are as follows:
Authentication Encryption Diffie-Hellman Duration
algorithm algorithm group (seconds)
--------------------------------------------------------
authentication pre-share
encryption esp-aes 192 #加密算法
lifetime 86400 #IKE SA的生命周期,单位秒(s)
The ISAKMP keyring stores the pre-shared key used to authenticate the
pre-shared-key address 119.XX.XX.94 key test@1234 #云上VPN网关的标识和预共享密钥
An ISAKMP profile is used to associate the keyring with a particular
endpoint. IKE negotiation mode for phase 1 uses Main mode. #协商模式。main:主模式,aggressive:野蛮模式
Uses the IP address of the user gateway as the local ID. Uses the WAN IP
address of the VPN gateway as the remote ID.
self-identity address 180.XX.XX.137 #用户本地VPN网关的标识
match identity address 119.XX.XX.94 #云上VPN网关的标识
By default, the time-based IPsec SA lifetime is 3600 seconds.
The IPsec transform set defines the encryption, authentication, and IPsec
mode parameters. IP packets are encapsulated in tunnel mode.
crypto ipsec transform-set vsr esp-aes 192 esp-md5-hmac #IPsec的加密算法和认证算法
IPsec uses access lists to identify the traffic to be protected. Configure
the access list to identify data flows.
access-list 101 permit ip 2.2.2.2 0.0.0.0 1.1.1.1 0.0.0.0
access-list 101 permit ip 2.2.2.2 0.0.0.0 172.1.1.1 0.0.0.0
access-list 101 permit ip 3.3.3.3 0.0.0.0 1.1.1.1 0.0.0.0
access-list 101 permit ip 3.3.3.3 0.0.0.0 172.1.1.1 0.0.0.0
access-list 101 permit ip 4.4.4.4 0.0.0.0 1.1.1.1 0.0.0.0
access-list 101 permit ip 4.4.4.4 0.0.0.0 172.1.1.1 0.0.0.0
ACL for VPN connection probe
The IPsec crypto map references the IPsec transform set, the ISAKMP profile
and the access list. The PFS feature is disabled for the IPsec crypto map.
crypto map 1 1 ipsec-isakmp
set peer 119.XX.XX.94 #IPsec peer
set pfs group1 #IPsec阶段的DH算法
set security-association lifetime seconds 3600 #生命周期,单位秒(s)
#3: Interface Configuration
Apply the IPsec crypto map to an interface. All traffic routed to the
interface will be encrypted and transmitted to the VPC. Traffic from the VPC
will be received on this interface.
ip address 180.XX.XX.137 255.255.255.0 #配置用户本VPN网关,所有路由到此处的流量都将被加密并传输到云上VPC,云上VPC的流量将下发此处并接收。
#4: Routing Configuration
Configure static routing or a routing protocol for interconnections between the
Virtual Private Gateway and your User Gateway.
ip route 172.1.1.1/32 119.XX.XX.94
ip route 1.1.1.1/32 119.XX.XX.94