iptables默认规则

原文链接: http://www.cnblogs.com/outsrkem/p/11180036.html
  • iptables默认规则
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [34:4104]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# 允许我发出去的数据包入站
-A INPUT -p icmp -j ACCEPT
# 允许ICMP协议
-A INPUT -i lo -j ACCEPT
# 允许回环网卡
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
# 允许ssh连接
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
# 拒绝所有其他不符合上述任何一条规则的数据包。并且发送一条host prohibited的消息给被拒绝的主机
COMMIT

转载于:https://www.cnblogs.com/outsrkem/p/11180036.html

你可能感兴趣的:(iptables默认规则)