#!/bin/bash iptables -F iptables -X iptables -t nat -F iptables -t nat -X iptables -t mangle -F iptables -t mangle -X iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT echo 1 > /proc/sys/net/ipv4/ip_forward iptables -F -t nat iptables -t nat -A PREROUTING -p tcp --dport 31337 -j DNAT --to 192.168.100.40:31337 iptables -t nat -A POSTROUTING -j MASQUERADE