以下是我的IP列表输出。 什么IP表命令应该发出启用添加的TCP端口444,我正在使用非标准的SSL。 我试过了“iptables -A INPUT -p tcp -dport 444 -j ACCEPT”,而不是“service iptables save”,但那不起作用?!?1 ?! 在我的httpd.conf中,我正在监听端口444。
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere REJECT all -- anywhere 127.0.0.0/8 reject-with icmp-port-unreachable ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:30000 ACCEPT icmp -- anywhere anywhere icmp echo-request REJECT all -- anywhere anywhere reject-with icmp-port-unreachable SSH_CHECK tcp -- anywhere anywhere tcp dpt:ssh state NEW ACCEPT tcp -- anywhere anywhere tcp dpt:ftp ACCEPT tcp -- anywhere anywhere tcp dpt:snpp Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-port-unreachable Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere tcp spt:ftp-data Chain RH-Firewall-1-INPUT (0 references) target prot opt source destination Chain SSH_CHECK (1 references) target prot opt source destination all -- anywhere anywhere recent: SET name: SSH side: source DROP all -- anywhere anywhere recent: UPDATE seconds: 180 hit_count: 3 name: SSH side: source
在您当前的规则集中,使用-A添加的规则将不起作用,因为您有一个拒绝规则。 使用-I而不是-A来规则规则插入在第一位。 或者“我input2”更好,因为它将规则插入到第二位。 性能原因,ESBLISHED,RELATED应该是第一位的。
名称snpp不是问题。 你的方法应该工作。 如果您将iptablesconfiguration为允许目标端口444和configuration的httpd在444上进行侦听,则客户端应该能够像https://your.ip.addr.ess:444/那样访问端口444上的https://your.ip.addr.ess:444/ 。
但是,如果您希望客户端使用https://your.ip.addr.ess/等默认端口访问https URL,则需要添加NAT规则,如:
iptables -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 444