2

我正在使用 terraform 创建资源,并且我在子网 172.1.0.0 中有一个节点,没有为该节点分配安全组或规则;该节点有两个端点 22 和 80。

我使用 nmap 确认端口已打开,它们是:

nmap -Pn -sT -p T:11 some-ingress.cloudapp.net

Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-08 19:02 EAT
Nmap scan report for some-ingress.cloudapp.net (1.2.3.4
Host is up (0.31s latency).
PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 1.34 seconds


nmap -Pn -sT -p T:80 some-ingress.cloudapp.net

Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-08 19:02 EAT
Nmap scan report for some-ingress.cloudapp.net (1.2.3.4)
Host is up (0.036s latency).
PORT   STATE SERVICE
80/tcp open  http

Nmap done: 1 IP address (1 host up) scanned in 0.09 seconds

我已经在节点上安装了 nginx 并运行curl 172.1.0.4curl 127.0.0.1curl 0.0.0.0为我获取了默认的 nginx 页面。

但是运行curl <public ip>curl <dns name>挂起,我得到一个

curl: (56) Recv failure: Connection reset by peer

我的 iptables 规则是:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

为什么我不能在节点的公共 ip 上访问 nginx?

该节点位于虚拟网络中,如果需要,我可以发布 terraform 配置172.1.0.0/16的子网。172.1.0.0/24

4

0 回答 0