Iptables - 无法打开端口443


0

我正在尝试设置https,但是我很难打开该端口。

Nmap scan report for localhost (127.0.0.1)
Host is up (0.000073s latency).
PORT    STATE  SERVICE
443/tcp closed https

这是我的/etc/sysconfig/iptables档案:

# Generated by iptables-save v1.4.7 on Tue Sep 18 03:42:22 2012
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [21660:1221924]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p icmp -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
-A FORWARD -j REJECT --reject-with icmp-host-prohibited 
COMMIT
# Completed on Tue Sep 18 03:42:22 2012

(我跑service iptables restart了没有错误)

我真的很感激一些快速的帮助:)

(iptables -S提供与上面相同的输出):

[root@weather-bell ~]# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
[root@weather-bell ~]#

修改后的问题

发布的输出netstat -ntl | grep 443iptables -nvL
Ansgar Wiechers

什么OS?你试过ufw允许443吗?
d4v3y0rk

等等,什么?刚刚注意到你是从localhost(Nmap scan report for localhost)扫描的。即loopback rule(-A INPUT -i lo -j ACCEPT)是iptables配置中唯一重要的规则。你确定在localhost上听到了什么吗:443?
atzz
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.