首页 > 解决方案 > Ubuntu Compute Engine VPS 上的 Google Cloud IKEv2 VPN

问题描述

正如我在标题中所说,我正在安装 strongSwan 并在 VPS 上配置 IKEV2 VPN。

但是,如您所知,GCP 有它的防火墙规则,我对此并不熟悉。

我正在使用这个脚本来安装 strongSwan IKEV2 VPN ( https://github.com/truemetal/ikev2_vpn )

iptables -A INPUT -p udp --dport  500 -j ACCEPT
iptables -A INPUT -p udp --dport 4500 -j ACCEPT

iptables -A FORWARD --match policy --pol ipsec --dir in  --proto esp -s 10.10.10.10/24 -j ACCEPT
iptables -A FORWARD --match policy --pol ipsec --dir out --proto esp -d 10.10.10.10/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.10.10/24 -o eth0 -m policy --pol ipsec --dir out -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.10.10/24 -o eth0 -j MASQUERADE
iptables -t mangle -A FORWARD --match policy --pol ipsec --dir in -s 10.10.10.10/24 -o eth0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360

iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP

有人可以帮我将这些规则应用到 GCP 防火墙规则中吗?

标签: google-cloud-platformgoogle-compute-enginevpniptablesvps

解决方案


推荐阅读