[CentOS]iptables设置,刚弄死一台服务器,请各位帮我看看怎么修改
对外开放的服务有 http (80) / https (443) / ssh(1433) / ftp (1434 : 2000~2099) / 某服务 (12921/10086)
脚本如下:
脚本如下:
#!/bin/bash
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
ServicePorts="80 443 1433 1434 2000:2099 10086 12921"
AccessPorts="20 21 22 53 80 443 1433 1434 2000:2099 3306 10086 12921"
#Default
iptables -P INPUT DROP
#Access
for aPort in $AccessPorts ; do
iptables -A INPUT -i eth1 -p tcp --sport $aPort -j ACCEPT
iptables -A INPUT -i eth1 -p udp --sport $aPort -j ACCEPT
done
#Service
for sPort in $ServicePorts ; do
iptables -A INPUT -i eth1 -p tcp --dport $sPort -j ACCEPT
iptables -A INPUT -i eth1 -p udp --dport $sPort -j ACCEPT
done
...全文


系统维护与使用区
