google-cloud-platform - 使用 Strongswan 在 GCP 上的站点到站点 VPN
问题描述
有 3 个不同的项目,我从 Strongswan VPN 计算引擎为所有人设置了一条隧道。
下面是 ipsec.conf 文件
conn strongswan-to-ops
ikelifetime=600m # 36,000 s
keylife=180m # 10,800 s
rekeymargin=3m
keyingtries=3
keyexchange=ikev2
mobike=no
ike=chacha20poly1305-sha512-curve25519-prfsha512,aes256gcm16-sha384-prfsha384-ecp384,aes256-sha1-modp1024,aes128-sha1-modp1024,3des-sha1-modp1024!
esp=chacha20poly1305-sha512,aes256gcm16-ecp384,aes256-sha256,aes256-sha1,3des-sha1!
authby=psk
left=172.x.x.x # In case of NAT set to internal IP, e.x. 10.164.0.6
leftid=172.x.x.x
leftsubnet=192.x.x.x/24
leftauth=psk
right=[gateway IP]
rightid=[gateway IP]
rightsubnet=172.x.x.x/16
rightauth=psk
type=tunnel
auto=start
dpdaction=restart
IPsec 状态显示
Security Associations (2 up, 0 connecting):
strongswan-to-ops[4]: ESTABLISHED 46 minutes ago,
strongswan-to-ops{3}: INSTALLED, TUNNEL, reqid 2, ESP in UDP SPIs: c233fb9c_i 17261c13_o
strongswan-to-ops{3}: 192.x.x.x/24 === 172.x.x.x/16
但仍然无法访问其他项目上的 HTTP 服务器/其他 VM
解决方案
在 GCP 计算引擎上,IP 转发已关闭,所以这就是问题所在。
我拍摄了 Compute Engine 的快照并使用它创建新的,并将 IP 转发标记为 ON。
推荐阅读
- javascript - 创建具有特定 ID 号的新元素。使用 JS
- javascript - 渲染后如何在 Grid.js 中添加(或替换)数据?
- python - 返回包含给定时间(当前时间)的时间段
- excel - 在打印 PDF 之前不更新值
- vba - 先进先出分配
- javascript - 动态地将 aria-hidden 标签添加到主干视图
- python - 根据另一列减去某个熊猫数据框列的最小值
- ssl - 如何避免从 AWS 迁移到 GCP 的停机时间?通常用于负载平衡和 SSL 设置
- react-native - Expo Recording + Google Cloud Storage:文件损坏?错误的 API POST?
- http - How to extract comma separated values from query parameter in Go?