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 06-07-2009, 06:32 AM   #1
laode
LQ Newbie
 
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Rep: Reputation: 0
use ssh form web to 2 LAN-PC


Hi,

I setup successfuly 1 dynDNS hostname for 1 PC in my LAN behind a DSL-router, installed inadyn client on that PC, setup port-forwarding in the router to this PC and so I can connect wiht ssh from outside of my LAN.

Now I tried to configure similar for another PC in LAN, but I can't make it working.

What I did:

1. define new dynDNS-hostname
2. install inadyn-client according to new host-name
3. tried 2 options in router:
1 setup port-forwarding (TCP=4222, UDP=22)
2 setup virtual server (public=4222, privat=22) setup client for ssh with port 4222

in case 3.1 router denies that, because port allready used for PC 1
in case 3.2 I get network timeout after several minutes on the client.

what amI doing wrong ?

Somehow I have the feeling, that my router (D-Link DIR-635) has different understanding of port-forwarding, than most the threads, telling to use different port than 22 for ssh.
I don't know exactly what the difference between port-forwarding and virtual server is.

anybody can tell me, how to do it well ?

thanks for any tip, laode
 
Old 06-08-2009, 03:04 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well you should want port forwarding, and you should be able to use 22 for the internal and external ports. I'm not sure why you're referring to tcp and udp - ssh only uses tcp.
 
Old 06-08-2009, 07:58 PM   #3
laode
LQ Newbie
 
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Original Poster
Rep: Reputation: 0
port forward resp. port translation

Hi,

Thanks for answering. My answer to your question is basically quite easy:

first of all I am not well-experienced in network-stuff,
second, because my router D-Link DIR-635 provides just this fields (TCP,UDP, IP-Adress) in the menue 'port-forwarding'.
Meanwhile I think I understand a bit more and so I think this router-menue can not solve my problem, because it does just what it says: port-forwarding, while I need a port-translation for the 2nd PC using ssh as well, since it is not possible to forward 1 port to 2 machines.

I tried also menue 'vitual server', where I have fields for public port and private port, but it didn't work. May be this is basically the right menue and I did something wrong in it, so I have to learn more to understand router-messages.

I will do some more tests with 'virtual server' and post the result here.
A guiding text in that menue says, that this suitable for ftp-server or web-servers, which sound well matching to what I intend to do -> provide a ssh-server for my privat connects via web.

laode
 
Old 06-10-2009, 02:52 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
laode,

3.1:

You should be able to get this to work using virtual server; use the router menu to forward any unblocked port to port 22 on the linux server. Some routers have horrible interfaces, requiring a second step to enable a virtual server rule, or even need to reset just to enable your settings. You shouldn't have to change the ssh server at all in this case.


3.2:

You can also use port forwarding on the same port, although it's a bit more work. In this case, you need to choose an unblocked port and use that port number for SSH. In /etc/ssh/sshd_config you can specify the port lines that SSH listens to (only port 22 by default). You can add extra lines to accept connections on different ports. eg:
Code:
Port 22
Port 4222

Either way, one thing you can do is to run nmap (http://nmap.org) on your server from outside the network. This will tell you which ports you have open as visible on the outside world. If it doesn't show your ssh port, then either you have not opened it in the router, or your ISP has blocked it.

Hope that helps,

— Robert J Lee.
 
Old 06-10-2009, 03:13 PM   #5
laode
LQ Newbie
 
Registered: Jun 2009
Distribution: ubuntu 8.04-9.04
Posts: 5

Original Poster
Rep: Reputation: 0
forward or translateion of ports

Hi J.Lee,

Thanks for your comment. You help me in convincing my understanding of port-forwarding.

Meanwhile I tested also port forwarding with 4222 and changed ssd.conf to 4222 as well as clinet (putty), but could not get it run.

currently I can't test, because I tried to install earlier Ubuntu (8.10) to overcome some other compatibility problems with UB 9.04 and Oracle.

Unfortunately Grub is not able to start since :-((
but that's another story.

I will continue testing forwarding and virtual server as soon as my System is back alive.

Thanks for your comments on some router-side effects. My experience about D-Link DIR-635 is not bad so far, the menues are clear and logical and the side-help-text telling about the features background, which helps a lot in deed.

cheers Laode
 
  


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
perl and web form ilnli Programming 2 11-17-2006 05:03 AM
Web form and database... Scrag Programming 4 12-22-2004 05:23 AM
Help with setting a Web form the_imax General 5 11-20-2004 04:57 PM
apache unreachable form lan kubicon Linux - Networking 4 08-10-2003 05:18 PM
Your web form is off its not am its pm maximalred Linux - Distributions 2 04-08-2003 09:36 PM

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

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