Skip to content

Instantly share code, notes, and snippets.

@LordAmit
Created January 1, 2014 15:59
Show Gist options
  • Save LordAmit/8209072 to your computer and use it in GitHub Desktop.
Save LordAmit/8209072 to your computer and use it in GitHub Desktop.
Urban terror server port forwarding
#!/bin/bash
#<- this is a comment.
newport=2222
forwardport=27960
sudo iptables -t nat -A PREROUTING -p udp --dport $newport -j REDIRECT --to-ports $forwardport
#To check whether this rule works, type this command
#sudo iptables -nL -v --line-numbers -t nat
#if you want to disable it, simply type this command
#sudo iptables -t nat -D PREROUTING -p udp --dport $newport -j REDIRECT --to-ports $forwardport
#Written by Zed, modified and maintained by LordAmit of UrTBD Clan.
#Correction, iptable checking commannd provided by Bunny of Valhalla Clan.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment