#/bin/sh iptables -t nat -A POSTROUTING -s 192.168.0.x/32 -j SNAT --to-source x.x.x.x iptables -t nat -A POSTROUTING -d 192.168.0.x -s 192.168.0.0/24 -p tcp --dport 10002 -j SNAT --to 192.168.0.1 iptables -t nat -A POSTROUTING -d 192.168.0.x -s 192.168.0.0/24 -p udp --dport 10002 -j SNAT --to 192.168.0.1 iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 10002 -j DNAT --to 192.168.0.x:10002 iptables -t nat -A PREROUTING -i eth0 -p udp --dport 10002 -j DNAT --to 192.168.0.x:10002 iptables -t nat -A PREROUTING -d x.x.x.x -p tcp --dport 10002 -i eth1 -j DNAT --to-destination 192.168.0.x:10002 iptables -t nat -A PREROUTING -d x.x.x.x -p udp --dport 10002 -i eth1 -j DNAT --to-destination 192.168.0.x:10002 ## x.x.x.x = ip real ## 192.168.0.1 = ip-ul interfetei dinspre retea ## eth0 = interfata dinspre retea ## 10002 = portul forwardat ##192.168.0.x = ip-ul calc retea ## La odc se seteaza ip=x.x.x.x si port 10002