IPTABLES Forward ทราฟฟิก Outside

By | 13/11/2014

[cc lang=”c”]service iptables stop
echo “1” > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp –dport 21 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 25 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 443 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 143 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 110 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A PREROUTING -p tcp –dport 2222 -j DNAT –to-destination 12.12.12.12
iptables -t nat -A POSTROUTING -j MASQUERADE[/cc]

ใส่ความเห็น