主机防火墙

 

#允许本机IO
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
#让自已的IP通过
iptables -A INPUT -s 10.0.10.0/24 -p all -j ACCEPT
iptables -A INPUT -s 10.0.0.0/24 -p all -j ACCEPT
#SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
#HTTP
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
#PING
iptables -A INPUT -p icmp -m icmp --icmp-type any -j ACCEPT
#
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

 

posted @ 2016-06-13 22:06  bass  阅读(202)  评论(0编辑  收藏  举报