IPTABLES Forward ทราฟฟิก Outside

By | 13/11/2014
1
2
3
4
5
6
7
8
9
10
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

ใส่ความเห็น