ip_forward sample

# clean all rules
iptables -F
iptables -t nat -F
iptables -X
iptables -Z

#default chain
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -P  PREROUTING ACCEPT
iptables -t nat -P      OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT

iptables -A INPUT -s 10.0.0.0/8 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

#modify rule below this line
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.140.0.3:80
iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to-destination 10.140.0.3:3389
iptables -t nat -A POSTROUTING -j MASQUERADE

iptables -L -n -t nat