#启动iptables服务
service iptables start
#设置iptables服务默认开机启动
chkconfig iptables on
#添加过滤80端口规则
iptables -t filter -A INPUT -p tcp -m tcp --dport 8080 -s localhost -j ACCEPT
iptables -t filter -A INPUT -p tcp -m tcp --dport 8080 -j REJECT
service iptables start
#设置iptables服务默认开机启动
chkconfig iptables on
#添加过滤80端口规则
iptables -t filter -A INPUT -p tcp -m tcp --dport 8080 -s localhost -j ACCEPT
iptables -t filter -A INPUT -p tcp -m tcp --dport 8080 -j REJECT