#!/bin/sh iptables --flush iptables --table nat --flush iptables --delete-chain iptables --table nat --delete-chain iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE iptables -A FORWARD -i eth1 -j ACCEPT iptables -t nat -A PREROUTING -p tcp --dport 10000:19999 -j DNAT --to-destination 192.168.0.2 iptables -t nat -A PREROUTING -p udp --dport 10000:19999 -j DNAT --to-destination 192.168.0.2 iptables -t nat -A PREROUTING -p tcp --dport 20000:29999 -j DNAT --to-destination 192.168.0.3 iptables -t nat -A PREROUTING -p udp --dport 20000:29999 -j DNAT --to-destination 192.168.0.3 iptables -t nat -A PREROUTING -p tcp --dport 30000:39999 -j DNAT --to-destination 192.168.0.4 iptables -t nat -A PREROUTING -p udp --dport 30000:39999 -j DNAT --to-destination 192.168.0.4 iptables -t nat -A PREROUTING -p tcp --dport 40000:49999 -j DNAT --to-destination 192.168.0.5 iptables -t nat -A PREROUTING -p udp --dport 40000:49999 -j DNAT --to-destination 192.168.0.5 echo 1 > /proc/sys/net/ipv4/ip_forward