LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 12-24-2005, 02:31 AM   #1
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
Question Interesting routing via ssh tunnels.


I have been attempting recently to gain remote access to a machine behind a firewall. The trick is this: the machine I need access to is behind a firewall, and in that firewall the only known hole is to a different machine via ssh. I was able to setup an iptables rule to forward the port I needed to the unreachable machine, and I thought it would be a simple matter of using an ssh forwarding rule to get to this machine and allow iptables to take over. So what I have now is an ssh rule:

ssh -L1700:localhost:1700 remote

This begins the forwarding from my machine to the reachable inside. Then the iptables rule looks like this:

iptables -A FORWARD -s 0/0 -i eth0 -d unreachable -o eth0 -p TCP --sport 1700 --dport 1700 -j ACCEPT

This should let me connect as such:

local -> ssh tunnel -> remote -> forward -> unreachable

The problem is that it works inside, but not when I am outside of the firewall. I was under the impression this would solve all of my problems. I'm open to suggestions, and if more info is needed (I think I covered it all) I will provide it.

Thanks in advance,

Alunduil
 
Old 12-24-2005, 04:04 AM   #2
RandomLinuxNewb
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
You can always have the unreachable machine connect to you using SSH and setup a reverse tunnel that you can then connect to on your local machine.

On the unreachable machine run this.
Code:
ssh -R 1080:unreachable:22 user@reachable
Then on the reachable machine.
Code:
ssh -p 1080 user@localhost
What this does is connect to the ssh session that the unreachable machine created. The only problem is that you have to make sure this tunnel stays open so your going to need to keep some activity going over the tunnel. Or set the timeout setting the sshd.conf file to a really large number.
 
Old 12-26-2005, 01:47 PM   #3
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Original Poster
Rep: Reputation: 62
The true problem I guess I forgot to mention was that unreachable AFAIK only has the one port open running a license manager server. This server is what I need to get to, and I have no rights on it. Not even piddly user rights through a web interface. I have to just get my packets to the machine and back, but don't know a way to do this. Thanks for the suggestion, it's just not feasible.

Thanks,

Alunduil
 
  


Reply



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
SSH to Slack from Winxp at work biledaemon Slackware 4 12-28-2005 04:50 AM
Help with basic SSH concepts. dr_zayus69 Linux - Networking 1 12-23-2005 01:57 PM
routing problem - something interesting Steave Linux - Networking 2 01-06-2005 09:11 AM
bridging, routing and tunnels -- oh my! MatthewSabin Linux - Networking 1 08-27-2004 04:07 PM
Interesting Routing Problem karunesh Linux - Networking 3 04-14-2002 10:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration