标签:iptables
【iptables配置】简单的iptables示例
iptables-save >rc.firewall.txt
*filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -s 192.168.100.0/24 -i em1 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 10050:10051 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 10050:10051 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
恢复:
# iptables-restore rc.firewall.txt
查看状态:
# iptables -L -n
# service iptables status
保存:
# service iptables save
标签:iptables
原文地址:http://nosmoking.blog.51cto.com/3263888/1595607