LinuxQuestions.org
Help answer threads with 0 replies.
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 11-12-2014, 05:37 PM   #1
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283
Blog Entries: 11

Rep: Reputation: 41
Unhappy Port forwarding not allowed when client is inside the LAN


This router is a Netgear WNDR3700v4, and for now, I keep the default settings.
Inside the LAN, there is my host 'vvv', with this IP:192.168.2.4
In order to connect to this box through ssh from the outside, I have forwarded its port 22 to the router port 8924.
So, from an outside computer, I get:
Quote:
$ ssh -vv -p8924 xri.is-a-geek.com
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Reading configuration data /home/xri/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to xri.is-a-geek.com [97.11.124.79] port 8924.
debug1: Connection established.
debug1: identity file /home/xri/.ssh/id_rsa type 1
etc [it connects without a problem]
When I try the same from another box inside the local network:
Quote:
$ ssh -vv -p8924 xri.is-a-geek.com
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Reading configuration data /home/xri/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to xri.is-a-geek.com [97.11.124.79] port 8924.
debug1: connect to address 97.11.124.79 port 8924: Connection refused
ssh: connect to host xri.is-a-geek.com port 8924: Connection refused
With my previous router I didn't have this problem. I've been looking in the manual, but I do not see any specific setting or solution to allow inside computers use the same ports as outside computers do, for ssh.
Could you give me a hint here? What to read? What to look for?
Thanks for reading this.
 
Old 11-12-2014, 07:13 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Sounds like a loopback problem. Some routers/modems block loopback connections (connecting to your own WAN IP from inside the LAN). You should check if there's an option to enable/disable this, but if not, you may be out of luck.

BTW - I hope you changed the URL, IP, username, and port numbers in your post, otherwise everybody in the world now knows how to hit the ssh server on your box, AND a valid username to use.
 
1 members found this post helpful.
Old 11-13-2014, 06:40 PM   #3
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
Thanks for your prompt answer.
I'll keep looking and playing with it.
BTW all my posts are carefully sanitized
 
Old 11-13-2014, 08:50 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,878

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Set an entry to resolve your domain name to the local IP in either your local DNS or your hosts file.
 
Old 11-17-2014, 12:35 PM   #5
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
Thank you, descendant_command.
I followed your advise, and the result is exactly the same
 
Old 11-17-2014, 12:51 PM   #6
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,878

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You'll need to connect to port 22, unless you've set sshd to listen on 8924 as well.
 
Old 11-17-2014, 01:19 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,890

Rep: Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985Reputation: 5985
I have a Netgear WNDR3700v3 and can ssh from inside the LAN using my external IP address so unless there is a big difference in firmware there should not be a loopback problem. I forward the same port number but that should not be a problem either.

You have not posted enough information but are you using keys or typing in a password? Is the local and outside computer the same except for "location". If different, have you verified that both are configured the same?

I assume you can ssh from within the LAN i.e. using its local IP address and port 22 from the same box that fails using your external URL.
 
Old 11-18-2014, 06:24 AM   #8
linuxgurusa
Member
 
Registered: Mar 2008
Location: Namibia, Swakopmund
Distribution: Redhat, Fedora, Centos, ClearOS, Mandrake
Posts: 151

Rep: Reputation: 29
HI there

You specified the forwarding port in both examples, surely one must be port 22 and the other one 8924 ?
From outside port 22, which then goes inside on port 8924
So when you inside the network, use port 8924

??
 
Old 11-18-2014, 10:59 PM   #9
xri
Member
 
Registered: Aug 2002
Distribution: Archlinux, Garuda Linux
Posts: 283

Original Poster
Blog Entries: 11

Rep: Reputation: 41
Thank you for the replies.
The line on my original post is part of a script that I use in every case (the client computer is a laptop). It used to work on both locations (inside the LAN and away from it). Now it does not.
@michaelk, the fact that you have no problems using the outside port when you are inside strongly suggests that my issue has to do with the router configs. I will take a further look; I must have missed something...
 
  


Reply

Tags
firewall, network, port forwarding, router


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
Iptables Port forwarding from inside also Cidi Rome Linux - Networking 8 03-25-2014 06:51 PM
[SOLVED] Port Forwarding inside LAN not connected to a router nor internet lmorda Linux - Networking 16 02-08-2012 01:54 PM
Connect from home to a computer inside an "external" LAN using port forwarding horacioemilio Linux - Networking 1 03-07-2008 03:36 AM
Testing Port Forwarding from inside network? humbletech99 Linux - Networking 2 07-08-2006 02:37 AM
Outside FTP Port 21 redirect to different port inside LAN??? hendrixx Linux - Security 5 06-05-2004 06:42 PM

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

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