IPTABLE Redirect Traffic

By | 30/01/2018
Spread the love

[cc lang=”c”]
iptables -t nat -A PREROUTING -p tcp –dport 53 -j DNAT –to-destination 8.8.8.8
iptables -t nat -A PREROUTING -p tcp –dport 80 -j DNAT –to-destination 8.8.8.8
iptables -t nat -A PREROUTING -p tcp –dport 3306 -j DNAT –to-destination 8.8.8.8
iptables -t nat -A POSTROUTING -j MASQUERADE
echo “1” > /proc/sys/net/ipv4/ip_forward
[/cc]

8.8.8.8 คือ IP ปลายทาง

ใส่ความเห็น