技术解析
禁用25端口:
iptables -I FORWARD -p tcp --dport 25 -j DROP
禁用UDP,只开启53端口(DNS协议):
list=`grep nameserver /etc/resolv.conf |awk '{print $NF}'`for i in $listdo iptables -A OUTPUT -p udp -d $i --dport 53 -j ACCEPT done iptables -A OUTPUT -p udp -j DROP service iptables save