使用谷歌云服务开启8080等其他的端口

360 阅读1分钟

最近使用朋友的谷歌云服务器,发现无法开启8080等一些端口,查了很多资料,也改了防火墙之类的都没有效果,最后翻墙google了一下,找到了解决方案。

登录谷歌云服务器

  • 查询所有防火墙规则 gcloud compute firewall-rules list
  • 创建一个名为allow-ssr,端口号为1099的规则 gcloud compute firewall-rules create allow-ssr --allow tcp:1099
  • 删除一个名为allow-ssr的防火墙规则 gcloud compute firewall-rules delete allow-ssr