我通过iptables打开了端口443:
pkts bytes target prot opt in out source destination 45 2428 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 6 1009 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 141 10788 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 7 1140 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 6 360 DROP all -- * * 0.0.0.0/0 0.0.0.0/0
它正在监听netstat -a表示:
Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:6311 *:* LISTEN tcp 0 0 *:ssh *:* LISTEN tcp 0 0 gauss:ssh ommited ESTABLISHED tcp 0 0 gauss:ssh ommited ESTABLISHED tcp6 0 0 localhost:8005 [::]:* LISTEN tcp6 0 0 [::]:8009 [::]:* LISTEN tcp6 0 0 [::]:www [::]:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN tcp6 0 0 [::]:https [::]:* LISTEN udp 0 0 *:mdns *:* udp 0 0 *:52703 *:* udp6 0 0 [::]:42168 [::]:* udp6 0 0 [::]:mdns [::]:*
但是我不能ping端口443:
PING 443 (0.0.1.187) 56(124) bytes of data. ^C --- 443 ping statistics --- 7 packets transmitted,0 received,100% packet loss,time 6006ms
这是怎么回事?
解决方法
ping实用程序执行它应该的操作,使用ICMP命中ping接口,您不能只使用它ping任何端口.我确信有一百万种方法可以做到,但大多数人只是使用’telnet IP端口’,即’telnet 1.2.3.4 25’来测试连接.