LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-29-2009, 02:35 AM   #1
reticent
LQ Newbie
 
Registered: Sep 2009
Posts: 16

Rep: Reputation: 0
Ssh tunnel + DNAT on egress interface


Hey Guys,

This is pretty convulated. 10 Points to anyone who is able to comprehend what it is that I'm trying to achieve, and many more to anyone with a solution :P

The Story:
I've setup a shell in order to SSH Tunnel gaming traffic (specifically World of Warcraft...I hear some of you groan!) from New Zealand to West Coast WOW servers. For whatever reason this seems to negate a large chunk of latency and commonly reduces my ping by 100-200ms. I also have read a bit about the way the application uses ACK packets, or rather a lack of. By introducing the NODELAY flag in a tcp stream it seems the latency can be reduced further more. The article I reference is here, for anyone interested http://forums.worldofwarcraft.com/th...71071466&sid=1.

It seems this can be achieved by using both a DNAT (Masquerading under iptables) and a network swiss army knife of sorts, named socat. By using a DNAT you can redirect any traffic on WOW's port (TCP3724) through to socat, which runs as a daemon on that port, which introduces the NODELAY, and sends it on to the WOW server.

My problem is this, the linux machine im using is not my gateway. All traffic is tunnelled via SSH to this machine. I understand DNAT is performed on the ingress interface. My SSH traffic passes through this interface and arrives on the system, I then need it to be DNAT'd through to socat listening on 3724.

The command used is this:

iptables -t nat -A PREROUTING -p tcp -d your.wow.server.ip.address --dport 3724 -j REDIRECT --to-ports 3724

The problem I see is that this would occur only when the outside interface see's traffic on 3724 to dest your.wow.server.ip.address. When the traffic is bundled up in a SSH stream, is decrypted and forwarded it misses this NAT altogether, something which needs to occur in order for the system to work.

Currently, the SSHD port forwards all my WOW traffic back out to it's destination without doing the DNAT that I need it to do.

The Question

Is there anyway to have SSH traffic, when it's been decrypted on the SSHD, pass through the whole iptable 'system', as if it's a clear text packet which has arrived on the outside?

Last edited by reticent; 09-29-2009 at 02:39 AM.
 
Old 09-29-2009, 04:08 PM   #2
reticent
LQ Newbie
 
Registered: Sep 2009
Posts: 16

Original Poster
Rep: Reputation: 0
I was thinking, perhaps it's easy to find an application that is able to introduce the nodelay bit in a TCP stream. Does anyone know of an application which is able to do this?
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forward packets from a tunnel interface dushyant26 Linux - Networking 1 08-16-2010 09:04 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
SSH Port Forwarding with IPTables & DNAT MercurioBlue Linux - Networking 2 08-24-2006 11:17 PM
iptable dnat to lo interface - is it possible? idg Linux - Security 1 06-20-2005 07:00 AM
ssh tunnel TroelsSmit Linux - Software 2 04-30-2004 03:30 PM


All times are GMT -5. The time now is 08:56 AM.

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