Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-27-2007, 11:25 AM   #1
LQ Newbie
Registered: Nov 2005
Location: Corona, CA
Posts: 12

Rep: Reputation: 0
UDP tunnel/packet forwarder

Anyone know a good way to do a UDP tunnel? Maybe through IPtables?

Basically here is the situation:

I have a box that has two NICs on it and it used to have two IP addresses (the IPs have been changed). Lets say they were:


This worked out good for me but a routing change happened and now I do not get so good latency to either IPs and I run several game-servers off of. Now here is the issue, I don't really want to change the IP address of the gameservers but I found another IP I can use, lets call this one I get quite a bit better of a ping to this IP so I changed my configu. it is now:


So Basically my gameservers are still accessible by the IP they always have been but I (only for my own use) would like to connect ot them using the IP as I ping better to that IP. Well the problem is that the gameserver software only listens on the IP and not the IP and if I don't specify the IP when starting the game-server then it listens on all IPs but the problem is that the IP that is sent to the master server will be which is really bad because I do a lot of traffic on eth0 and I don't want my gameserver to be effected by the traffic. I have the box setup so that all traffic always goes out of eth0 unless the program itself binds itself to eth1's IP.

Anyway here is what I thought as a solution was. Setup a UDP tunnel on which forwards to so I can connect using giving me the lower latency I desire without having to actually change the servers IP itself. The problem is how do I do this... I have seen several programs that tunnel UDP over TCP and stuff like that but I don't need anything like that I just need a really simple tunnel which listens on on a specific port (UDP) and forwards traffic to (same port UDP). I think this might be achievable using iptables but I am not sure how.

Any suggestions?
Old 11-28-2007, 04:52 AM   #2
LQ Newbie
Registered: Nov 2005
Location: Corona, CA
Posts: 12

Original Poster
Rep: Reputation: 0
I tried several forwarding tools but none of them seemed to work until this one:


This one did exactly what I wanted and worked great. The only problem is that it can't bind to specific interfaces so it would listen on all the interfaces but this limitation was easy to get around as I am used to programs not having the ability to bind to an interface (I have multiple connections so I had to search away around this in the past) and used it in conjunction with:


That way I could have the server on the same port as the original one. What is kind of funny though is just after getting this working my routing changed and now the latency is the same even to the new IP address I added. Oh well. The whole point of this originally was the new IP I added to I had a good 10ms lower than the other two IPs but now they are all the same. Atleast if routing changes again I can make use of this.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Stop a UDP Packet Flood ! murder Linux - Newbie 2 09-19-2005 10:14 AM
setting packet forwarder b123coder Linux - Networking 1 05-05-2005 06:27 AM
UDP packet oss dazdaz Linux - Networking 2 04-05-2004 01:30 PM
game proxy ? udp forwarding ? tunnel ? n33dH3lp Linux - Networking 1 11-10-2003 12:13 PM
UDP: short packet markus1982 Linux - Security 4 08-12-2003 08:03 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:24 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration