LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-12-2003, 01:27 PM   #1
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Rep: Reputation: 30
forwarding a local port


Hi !

Since my ISP is a big m*thfscker sun of a beach, im trying to forward a remote port to home. Im login from home to the remote host like

ssh -g -R 10000:home.addr.ip.mine:20000 remote.host.forward.net

ok, im assuming that this is going to:

each connection into remote.host.forward.net:10000 will be forwarded directly to my home.addr.ip.mine:20000. Is this correct?

so i can intended to connect to home from anywhere like

ssh remote.host.forward.net:10000

and welcome home, isnt it?

anyways, when i try this i get the following error:


ssh_exchange_identification: Connection closed by remote host


what this error means? thansk a lot!
 
Old 10-12-2003, 01:40 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
From memory - try:
Code:
ssh -g -R 10000:home.addr.ip.mine:20000 remote.host.forward.net -N -l REMOTE_USERNAME
 
Old 10-12-2003, 01:50 PM   #3
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Original Poster
Rep: Reputation: 30
maybe i have to say to sshd at home to listen at 20000? or is this handled directly by the forwarding command?
 
Old 10-12-2003, 02:00 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
I assumed that you already had the required srevice running on port 20000? What service are you trying to run? ssh? To check if it is running on port 20000:
netstat -nlp | grep 20000

If it isn't then you need to add a Port option for all ports you want sshd to listen on to sshd_config and restart sshd- eg:
Port 22
Port 20000
 
Old 10-12-2003, 02:19 PM   #5
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Original Poster
Rep: Reputation: 30
yippie!


thanks!!
 
Old 10-12-2003, 05:37 PM   #6
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Original Poster
Rep: Reputation: 30
in order to forward ports also for http, sftp, etc.. must i do this for each desired service, or can i handle it somehow to forward any connections to port 10000 to the intended address (which would be my home address) with subport information that would connect to a specific service in home?

dunno if that even makes sense hopes someone understand what im saying, but maybe this is simply not possible
 
Old 10-13-2003, 12:13 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
If you want to do it via ssh you need to forward each port individually.
 
Old 10-14-2003, 09:52 AM   #8
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Original Poster
Rep: Reputation: 30
what other ways are to forward ports, besides ssh?
 
Old 10-14-2003, 12:20 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
You can use iptables to forward ports too but they aren't encrypted.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
forwarding url to local IP helot Linux - Networking 4 01-02-2005 08:53 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM

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

All times are GMT -5. The time now is 09:16 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