我正在尝试使用 iptables 打开 IMAP 端口 993 和 143。我想到了这样的规则:
-A INPUT -p TCP --dport 993 -j ACCEPT
我已经运行了命令,并添加到链中。iptables -L -v
返回:
Chain INPUT (policy ACCEPT 1358 packets, 105K bytes)
pkts bytes target prot opt in out source destination
40587 4761K fail2ban-ssh tcp -- any any anywhere anywhere multiport dports ssh
96 5199 ACCEPT tcp -- any any anywhere anywhere tcp dpt:smtp
11 580 ACCEPT tcp -- any any anywhere anywhere tcp dpt:imaps
4 176 ACCEPT tcp -- any any anywhere anywhere tcp dpt:imap2
2 88 ACCEPT tcp -- any any anywhere anywhere tcp dpt:8888
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1205 packets, 2969K bytes)
pkts bytes target prot opt in out source destination
Chain fail2ban-ssh (1 references)
pkts bytes target prot opt in out source destination
39398 4668K RETURN all -- any any anywhere anywhere
然后我很恐慌,因为没有办法保存规则。或者我不知道按回车键是否保存了它们,但这iptables save
不是可识别的命令,iptables --help
没有提到应用规则。我也不确定,iptables -L
输出是否意味着规则在重新启动之前处于活动状态,或者它是否尚未以某种方式被激活。
Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-14 11:51 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000013s latency).
Not shown: 993 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
443/tcp open https
3306/tcp open mysql
7777/tcp open cbt
9200/tcp open wap-wsp
我打开了在线端口扫描器网络服务,它也返回了相同的结果。
这是 iptables v1.4.2 和 ubuntu 14.10。