Networking Forums

Networking Forums > Computer Networking > Linux Networking > ssh tunnel

Reply
 
 
kristian
Guest
Posts: n/a

 
      03-28-2006, 03:07 PM
Hi all
I have a computer, let's call it FOO, with two nic's (10.0.0.254 and
192.168.0.254) and another, BAR, with one nic (192.168.0.32).

I want connections on i.e port 10001 on FOO to be forwarded to port
10000 on BAR. (Connections from both nic's)

On FOO I try:

# ssh -f -N -g -L 10001:192.168.0.254:10000 192.168.0.32

But get error
bind: Address already in use

That makes me think I have something set up to listen to port 10001
already, but nomatter what port I choose, I get the same error.

If I use netstat -na, i see the following:
# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address
State
tcp 0 0 0.0.0.0:111 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:10000 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:631 0.0.0.0:*
LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:*
LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:*
LISTEN
tcp 0 0 127.0.0.1:6011 0.0.0.0:*
LISTEN
tcp 0 0 192.168.0.254:32851 192.168.0.32:22
ESTABLISHED
tcp 0 0 192.168.0.254:32852 192.168.0.32:22
ESTABLISHED
tcp 0 0 192.168.0.254:32853 192.168.0.32:22
ESTABLISHED
tcp 0 0 192.168.0.254:32960 192.168.0.32:22
ESTABLISHED
tcp 0 0 192.168.0.254:32959 192.168.0.32:22
ESTABLISHED
tcp 0 0 :::20000 :::*
LISTEN
tcp 0 0 :::1002 :::*
LISTEN
tcp 0 0 :::10032 :::*
LISTEN
tcp 0 0 :::22 :::*
LISTEN
tcp 0 0 :::12345 :::*
LISTEN
tcp 0 0 ::1:25 :::*
LISTEN
tcp 0 0 ::1:6010 :::*
LISTEN
tcp 0 0 ::1:6011 :::*
LISTEN

Where I have tried to listen to ports 10032, 1002, 20000, 12345. So
something is happening...

Kristian

 
Reply With Quote
 
 
 
 
Jeremiah DeWitt Weiner
Guest
Posts: n/a

 
      03-29-2006, 04:16 PM
kristian <(E-Mail Removed)> wrote:
> Hi all
> I have a computer, let's call it FOO, with two nic's (10.0.0.254 and
> 192.168.0.254) and another, BAR, with one nic (192.168.0.32).


> I want connections on i.e port 10001 on FOO to be forwarded to port
> 10000 on BAR. (Connections from both nic's)


> On FOO I try:


> # ssh -f -N -g -L 10001:192.168.0.254:10000 192.168.0.32


At least part of your problem is that your syntax for the -L option
is incorrect. The "host" part of the option is supposed to be the
_remote_ host, where connections will be forwarded _to_, and you're
using the IP of FOO. If you want connections to be forwarded to BAR,
use the address of BAR. I'm not sure that that's the root of the
problem here, but it is something you'll need to fix.


> Where I have tried to listen to ports 10032, 1002, 20000, 12345. So
> something is happening...


Your netstat output shows you already have something listening to
all of those ports, except for 10001. So what programs are those? Try
'netstat -pan' as root to see what they are.


--
Oh to have a lodge in some vast wilderness. Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.
-- William Cowper
 
Reply With Quote
 
kristian
Guest
Posts: n/a

 
      03-30-2006, 12:01 PM
Jeremiah DeWitt Weiner skrev:
> kristian <(E-Mail Removed)> wrote:
> > Hi all
> > I have a computer, let's call it FOO, with two nic's (10.0.0.254 and
> > 192.168.0.254) and another, BAR, with one nic (192.168.0.32).

>
> > I want connections on i.e port 10001 on FOO to be forwarded to port
> > 10000 on BAR. (Connections from both nic's)

>
> > On FOO I try:

>
> > # ssh -f -N -g -L 10001:192.168.0.254:10000 192.168.0.32

>
> At least part of your problem is that your syntax for the -L option
> is incorrect. The "host" part of the option is supposed to be the
> _remote_ host, where connections will be forwarded _to_, and you're
> using the IP of FOO. If you want connections to be forwarded to BAR,
> use the address of BAR. I'm not sure that that's the root of the
> problem here, but it is something you'll need to fix.
>
>
> > Where I have tried to listen to ports 10032, 1002, 20000, 12345. So
> > something is happening...

>
> Your netstat output shows you already have something listening to
> all of those ports, except for 10001. So what programs are those? Try
> 'netstat -pan' as root to see what they are.
>
>
> --
> Oh to have a lodge in some vast wilderness. Where rumors of oppression
> and deceit, of unsuccessful and successful wars may never reach me
> anymore.
> -- William Cowper


Thank you.

I'm rather new to this, so bear with me...

If the remote host goes in the -L option, does it also go as the
mandatory hostname option to ssh? like # ssh -f -N -g -L
10001:192.168.0.32:10000 192.168.0.32

It is ssh that listens to the ports listed in netstat, my failed
attempts... But I kill those processes, so nobody is listening before I
start ssh., and still get the
bind: Address already in use error.

 
Reply With Quote
 
kristian
Guest
Posts: n/a

 
      03-31-2006, 08:04 AM

kristian skrev:
> Jeremiah DeWitt Weiner skrev:
> > kristian <(E-Mail Removed)> wrote:
> > > Hi all
> > > I have a computer, let's call it FOO, with two nic's (10.0.0.254 and
> > > 192.168.0.254) and another, BAR, with one nic (192.168.0.32).

> >
> > > I want connections on i.e port 10001 on FOO to be forwarded to port
> > > 10000 on BAR. (Connections from both nic's)

> >
> > > On FOO I try:

> >
> > > # ssh -f -N -g -L 10001:192.168.0.254:10000 192.168.0.32

> >
> > At least part of your problem is that your syntax for the -L option
> > is incorrect. The "host" part of the option is supposed to be the
> > _remote_ host, where connections will be forwarded _to_, and you're
> > using the IP of FOO. If you want connections to be forwarded to BAR,
> > use the address of BAR. I'm not sure that that's the root of the
> > problem here, but it is something you'll need to fix.
> >

> Thank you.
>
> I'm rather new to this, so bear with me...
>
> If the remote host goes in the -L option, does it also go as the
> mandatory hostname option to ssh? like # ssh -f -N -g -L
> 10001:192.168.0.32:10000 192.168.0.32
>
> It is ssh that listens to the ports listed in netstat, my failed
> attempts... But I kill those processes, so nobody is listening before I
> start ssh., and still get the
> bind: Address already in use error.


Seems like
# ssh -f -N -g -L 10001:192.168.0.32:10000 192.168.0.32
did the job...

I still get the error when I start it, but the forwarding works.

K

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with VPN tunnel Bill Network Routers 0 05-05-2010 07:54 AM
VPN Tunnel Robert Craig Windows Networking 12 11-18-2008 01:52 PM
Tunnel X over ssh Joe Hesse Linux Networking 1 10-30-2007 05:45 PM
FTP Using SSH Tunnel Buck Turgidson Linux Networking 3 09-16-2004 06:59 PM
ssh tunnel /dev/null Linux Networking 3 10-25-2003 08:09 PM



1 2 3 4 5 6 7 8 9 10 11