Telnet在AWS URL和localhost上有效,但在IP上无效

时间:2018-12-22 03:24:08

标签: amazon-web-services ubuntu amazon-ec2 telnet tcp-ip

这些工作正常:

telnet ec2-x-x-x-x.compute-1.amazonaws.com 443
telnet localhost 443
telnet internal.ip 443
telnet hostname 443

这些不起作用

telnet x.x.x.x 443
telnet freedns.dynu.com 443

但是端口80上的telnet都可以正常工作。

我的AWS Ubuntu 18框具有一个读取的 / etc / hosts 文件

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

netstat -ln说:

tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
  

我想念什么或我要去哪里错了?

     

从技术上讲,如果 ec2-x-x-x-x-x.compute-1.amazonaws.com 很好,那么IP   地址也应该很好。

1 个答案:

答案 0 :(得分:2)

您没有侦听IPv4端口80或443的进程(Web服务器)。您确实有侦听IPv6端口80和443的进程(Web服务器)。

问题是您的Web服务器未设置为0.0.0.0:80和0.0.0.0:443,或者您的Web服务器在启动期间失败。请查阅您的Web服务器日志文件。

这些地址只能用于解析IPv6地址。

telnet ec2-x-x-x-x.compute-1.amazonaws.com 443
telnet localhost 443
telnet internal.ip 443
telnet hostname 443