522   Linux

1,查看规则: -L -n -v
# iptables -t nat -L -n -v
# iptables -t filter -L -n -v

2, 清空规则:-F
# iptables -t nat -F //清空nat表的所有规则
# iptables -t filter -F //清空filter表的所有规则

3,路由转发,来自10.123.99.10:80的访问转向10.123.99.11:80:
# iptables -t nat -A PREROUTING -d 10.123.99.10 -p tcp –dport 80 -j DNAT –to-destination 10.123.99.11:80
# iptables -t nat -A POSTROUTING -j MASQUERADE

4,删除规则:
# iptables -t nat -D PREROUTING -d 10.123.99.10 -p tcp –dport 80 -j DNAT –to-destination 10.123.99.11:80
# iptables -t nat -D POSTROUTING -j MASQUERADE




Leave a Reply

Your email address will not be published. Required fields are marked *