You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
608 B
29 lines
608 B
#!/bin/sh
|
|
|
|
# 黄海反复试验了几次,发现在设置之前关闭防火墙才是最安全的办法,否则会发生连接不上的问题
|
|
service iptables stop
|
|
|
|
iptables -F
|
|
iptables -X
|
|
iptables -Z
|
|
|
|
# 据说这两句话是必不可缺少的
|
|
iptables -I INPUT -i lo -j ACCEPT
|
|
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
|
|
|
# 开放80端口
|
|
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
|
|
|
|
#信任IP
|
|
iptables -A INPUT -s 10.10.21.20 -j ACCEPT
|
|
|
|
#关闭其它人员进入
|
|
iptables -P INPUT DROP
|
|
|
|
|
|
# 保存iptbales规则
|
|
service iptables save
|
|
|
|
# 重新启动
|
|
service iptables restart
|