Welcome to the most active Linux Forum on the web.
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 02-09-2009, 07:28 PM   #1
paranoid times
Registered: Jan 2005
Distribution: Fedora Core 3, 4
Posts: 135

Rep: Reputation: 16
SSH tunnel only listening on loopback device. Should also listen on eth0

I have a server at home. Work normally just connects up to it with a reverse ssh connection such that I can get at the work computer easily. The work computer does a few tunnels one for ssh and another for http. The home server recently died. How convent it was that I was working on a new one at the time. Unfortunately it wasn't quite as complete as I expected.

The SSH tunnel is still working fine (after all the keys and such had been copied over). The HTTP tunnel isn't working the way it use to.

server: IP:
home computer: IP:
work computer: IP:

Previously I would connect to work by pointing my home computer at "" and if I wanted to connect to ssh I would connect up to the server and ssh to "" netstat is currently showing this:

tcp   0    0*        LISTEN      
tcp   0    0*        LISTEN
It use to look like this:

tcp   0    0*        LISTEN      
tcp   0    0*        LISTEN
The command that I use to connect up the tunnel is/was (I would just leave it in the crontab running periodically):
ssh -axfTCR 8220: michael@home sleep 6h
ssh -axfTCR 9220: michael@home sleep 6h

I've tried putting a -g on the options. Along with putting the ip address of the home server in front of the port ( I've looked through ssh_config and sshd_config on both sides. But nothing has stuck out to me or worked yet. The one notable difference that I could think of is the old server (that recently died) was Fedora 2 the new server is CentOS 5.2.

Any thoughts on what could get this working would be greatly appreciated.

Old 02-09-2009, 10:57 PM   #2
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
Maybe you can try this way

ssh -axfTCR eth0-ip:8220: michael@home sleep 6h

because this is the way i tunnel in the linux gateway and keep alive
(ssh -f -p 8022 -L sleep 30d)

hope you get the idea with this
Old 02-10-2009, 03:17 AM   #3
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
Also look for 'autossh', it keeps tunnels alive automagically.
Old 02-10-2009, 03:20 PM   #4
paranoid times
Registered: Jan 2005
Distribution: Fedora Core 3, 4
Posts: 135

Original Poster
Rep: Reputation: 16
It seems that adding:
GatewayPorts yes
To the sshd_config file on the home server has made it work. (found at:

Thank you very much for your help though and for letting me know about autossh, I didn't know that it existed and could be much nice then a cron script.

Thanks again,


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
loopback device renamed to eth0 AAnarchYY Linux - Networking 1 03-29-2007 04:03 PM
Why server socket listen() is not listening seungtaeh Linux - Networking 1 03-09-2007 05:32 AM
SSH reverse tunnel (lo only? why not eth0) Dinomight Linux - Networking 3 08-17-2006 10:44 PM
Postfix won't listen on loopback muff Linux - Software 2 09-07-2005 05:14 PM
xinetd and ipop3 listening only on loopback 3brothers Linux - Networking 3 10-13-2003 06:17 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:25 PM.

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