Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.