这是我的问题:
# iptables -P INPUT DROP # host -t mx gmail.com ;; connection timed out; no servers could be reached # iptables -P INPUT ACCEPT # host -t mx gmail.com gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com. gmail.com mail is handled by 5 gmail-smtp-in.l.google.com. gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com. gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com. gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com.
设置iptables删除所有input数据包,除非另有规定,我无法parsing主机,因此后缀无法发送邮件。 我认为设置防火墙至关重要 – 我错过了什么防火墙设置?
这里是我目前的iptables:
# iptables -L INPUT -n -v Chain INPUT (policy ACCEPT 120 packets, 17552 bytes) pkts bytes target prot opt in out source destination 2669K 160M fail2ban-ssh-ddos tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 22 2669K 160M fail2ban-ssh tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dports 22 122 19135 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 252 27262 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:143 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:587 46 3191 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 264 2459K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
您错过了一个规则来接受基于现有stream量的stream量(使iptables有状态的规则)。 这应该是你的第一条规则:
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT