开源软件StrongSwan与腾讯云V**网关V**对接实施方案
声明:
文档归档人—hunterxiao
版本说明:
版本 | 修订日期 | 修订内容 | 修订人 | 联系方式 |
---|---|---|---|---|
1.0 | 20180703 | 初稿完成 | hunterxiao | hunter_xiao@126.com |
目 录
业务数据需要在阿里云和腾讯云之间进行安全的传输。
性价比较高的方案是使用IPsec V**进行数据的传输。
阿里云VPC网段172.17.0.0/16 | 腾讯云VCP网段172.16.0.0/16 |
---|---|
阿里云V**网关IP 47.94.238.5 | 腾讯云V**网关IP 140.143.25.247 |
需要在两家云的VPC内分别创建V**网关
ECS选择Linux centos 7.4 (服务器创建过程不进行演示请自行查找)
远程连接服务器安装StrongSwan软件
yum install -y strongswan
cd /etc/strongswan/
ls
ipsec.conf ipsec.d ipsec.secrets strongswan.conf strongswan.d swanctl
vim ipsec.conf
config setup
uniqueids=yes
conn %defualt
ikelifetime=60h
keylife=20h
rekeymargin=3h
keyingtries=1
keyexchange=ikev2
mobike=no
type=tunnel
conn test1
leftid=47.94.238.56 #阿里云V**网关标识,推荐填写V** 网关的IP地址
left=0.0.0.0 #阿里云V** 网关的IP地址,可以使用0.0.0.0
leftsubnet=172.17.0.0/16 #允许阿里云VPC哪个地址段去访问腾讯云VPC地址段
rightid=140.143.25.247 #腾讯云VPC网关标识推荐填写腾讯云V**网关IP地址
right=140.143.25.247 #腾讯云V**网关的地址
rightsubnet=172.16.0.0/16 #腾讯云VPC地址段,允许阿里云访问腾讯云VPC的地址段
ike=3des-md5-modp768 #IKE加密认证算法
esp=3des-md5-modp768 #ESP加密认证算法
authby=secret #认证方式共享秘钥
auto=start #自动连接,add手动start自动
aggressive=no #V**协商默认,no表示是main模式,yes表示野蛮模式
dpdaction=none #DPD检测
keyexchange=ikev1 #ikev1
备注:vim可以使用粘贴模式这样不会出现错乱
vim 文件名,然后输入下面的命令
:set paste
输入命令后提示如下图
设置strongswan共享秘钥
vim ipsec.secrets
47.94.238.5 140.143.25.247 : PSK "123456"
vim strongswan.conf
# strongswan.conf - strongSwan configuration file
#
# Refer to the strongswan.conf(5) manpage for details
#
# Configuration changes should be made in the included files
aron {
duplicheck.enable = yes
load_modular = yes
filelog {
/var/log/strongswan.charon.log {
append = no
default = 1
flush_line = yes
ike_name = yes
time_format = %b %e %T
}
}
plugins {
include strongswan.d/charon/*.conf
stroke {
timeout = 4000
}
}
}
include strongswan.d/*.conf
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
grep forward /etc/sysctl.conf
net.ipv4.ip_forward = 1
sysctl -p
systemctl status strongswan.service
systemctl start strongswan.service
所属网络不要选错
IKE &IPSEC配置不要配错。
共享秘钥&对端网关IP地址不要设置错误。
SPD策略不要设置错误
通道配置汇总如下图:
路由配置
1 核对IKE配置
2 核对IPSEC配置
3 核对V**隧道敏感流量(SPD)
4 核对路由
5 核对是否有安全控制
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。