平時在搭建環境的時候,常常會有防火牆(iptables)的配置, 現整理成腳本,方便執行html
#! /bin/bash #---- settings rules ----------- iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -p icmp --icmp-type any -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -m multiport -p tcp --dport 80,21,3306 -j ACCEPT iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited /etc/rc.d/init.d/iptables save service iptables restart
原文連接: http://www.tojsp.com/linux/linux-centos-fedora-iptables-configure.htmllinux