如何在Google计算引擎上打开一个端口 [英] How to open a port on google compute engine
问题描述
在google计算引擎上,我可以通过'localhost'访问服务器上的端口,但无法使用来自同一服务器或外部客户端计算机的IP地址访问同一端口。我尝试在Web控制台页面上创建一个新的防火墙规则,并且可以从Linux命令中看到它,但仍无法访问端口8888。 c $ c> $ gcloud计算防火墙规则列表
名称网络SRC_RANGES规则SRC_TAGS TARGET_TAGS
allow8888默认值0.0.0.0/0 tcp:8888,udp:8888
默认允许-http默认值0.0 .0.0 / 0 tcp:80 http-server
default-allow-https default 0.0.0.0/0 tcp:443 https-server
$ b $从'localhost'更改为'0.0.0.0'解决了通过本地tcp服务器设置文件解决的问题
On google compute engine, I can access a port on a server through 'localhost', but I can not access the same port using IP address from the same server or from external client machines. I tried to create a new firewall rule on web console page, and can see it from Linux command, but port 8888 still can't be accessed
$ gcloud compute firewall-rules list
NAME NETWORK SRC_RANGES RULES SRC_TAGS TARGET_TAGS
allow8888 default 0.0.0.0/0 tcp:8888,udp:8888
default-allow-http default 0.0.0.0/0 tcp:80 http-server
default-allow-https default 0.0.0.0/0 tcp:443 https-server
Problem solved by changing local tcp server setting files from 'localhost' to '0.0.0.0'
这篇关于如何在Google计算引擎上打开一个端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!