
# 如何配置VPN对端设备？（HUAWEI USG6600配置示例）
因为隧道的对称性，在云上的VPN参数和您的VPN中需要进行相同的配置，否则会导致VPN无法建立连接。
在您自己数据中心的路由器或者防火墙上需要进行IPsec VPN隧道配置，具体配置方法取决于您使用的网络设备，请查询对应设备厂商的指导书。
本文以Huawei USG6600系列V100R001C30SPC300版本的防火墙的配置过程为例进行说明。
假设数据中心的子网为192.168.3.0/24和192.168.4.0/24，数据中心IPsec隧道的出口公网IP为1.1.1.2；VPC下的子网为192.168.1.0/24和192.168.2.0/24 ，VPC上IPsec隧道的出口公网IP为1.1.1.1。
#### 操作步骤
1. 登录防火墙设备的命令行配置界面。
2. 查看防火墙版本信息。
   ```
   display version 
   17:20:502017/03/09
   Huawei Versatile Security Platform Software
   Software Version: USG6600 V100R001C30SPC300(VRP (R) Software，Version 5.30)
   ```
   
3. 创建ACL。
   ```
   acl number 3065 vpn-instance vpn64
   rule 1 permit ip source 192.168.3.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
   rule 2 permit ip source 192.168.3.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
   rule 3 permit ip source 192.168.4.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
   rule 4 permit ip source 192.168.4.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
   q
   ```
   
4. 创建ike proposal。
   ```
   ike proposal 64 
   dh group5 
   authentication-algorithm sha1 
   integrity-algorithm hmac-sha2-256 
   sa duration 3600 
   q
   ```
   
5. 创建ike peer，并引用之前创建的ike proposal，其中对端IP地址是1.1.1.1。
   ```
   ike peer vpnikepeer_64
   pre-shared-key ********（********为您输入的预共享密码）
   ike-proposal 64
   undo version 2
   remote-address vpn-instance vpn64 1.1.1.1
   sa binding vpn-instance vpn64
   q
   ```
   
6. 配置IPsec proposal。
   ```
   IPsec proposal IPsecpro64
   encapsulation-mode tunnel
   esp authentication-algorithm sha1
   q
   ```
   
7. 配置IPsec策略，并引用之前创建的IPsec proposal。
   ```
   IPsec policy vpnIPsec64 1 isakmp
   security acl 3065
   pfs dh-group5
   ike-peer vpnikepeer_64
   proposal IPsecpro64
   local-address 1.1.1.2
   q
   ```
   
8. 将IPsec策略应用到相应的子接口上去。
   ```
   interface GigabitEthernet0/0/2.64
   IPsec policy vpnIPsec64
   q
   ```
   
9. 测试连通性。 在上述配置完成后，我们可以通过云上主机和数据中心的主机进行连通性测试，如下图[图1]所示。
   图1连通性测试   
   ![](https://support.huaweicloud.com/vpn_faq/figure/zh-cn_image_0000001592694217.png "点击放大") 
 
