Hero

...

redir

 

redir - Redirecting filtered IP

  • Sometimes it’s not possible to use a GRE tunnel because you don’t have root access over your destination server, running a Windows based server or simply don’t want to go through the possible headache of it.

installation

  • On Debian/Ubuntu:
    apt-get install redir
    
  • setup is very straight forward and consists of a single command
redir --laddr=BUYVM_FILTERED_IP --lport=PORT_TO_FORWARD_FROM --caddr=DESTINATION_IP --cport=DESTINATION_PORT &

# As an example:
redir --laddr=209.141.39.10 --lport=25565 --caddr=1.2.3.4 --cport=25565 &
This will redirect the standard Minecraft port to destination 1.2.3.4

create dedicated user

groupadd redir
useradd -m -s /bin/bash -g redir -c "redir - app user" redirapp
passwd -x -1 redirapp

create small script to run redir

  • vim redir.sh
#!/bin/bash

# some description
nohup redir --bind=192.168.0.12 --ident=redir-something --lport=10001 --laddr=192.168.0.12 --cport=22 --caddr=something.com > /var/tmp/redir-something.log 2>&1 &

run the script

su - redirapp ./redir.sh
  • Now just update your DNS or give your users your filtered IP and you’re set.

  • You may want to add the redir line to your /etc/rc.local so it starts up on reboot.