I don't see a port forwarding option in my router, how can I set up a ssh server then?
Sorry if this is something too basic, but I'm new in this kind of stuff... so I started a personal project a couple of days ago and for this little project I would like to connect to a notebook that I have (which is running CentOS 24/7) via SSH, actually I'm able to SSH to my notebook running CentOS with a device connected in my LAN, but I want to be able to do the same from anywhere, not just from my home, so according to what I've read I have to fordward port in my router, the problem is that I don't see this option...
My router is a DIR 615, Hardware Version: T1 and Firmware Version: 20.07
And these are all the options that I see:
Setup:
Wireless:
Advanced:
Maintenance:
Status:
Help:
What can I do? I've seen a lot of tutorials with the port fordward option, but they have other hardware version
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EDIT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I tried the Virtual Server option, but it didn't work for me...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EDIT 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Okay, so elaborating in "I tried the Virtual Server option, but it didn't work for me", I did this:
- First I visited to http://www.whatsmyip.org/ to know my public IP, lets say that my public IP is X (according to me this is the IP where anything from the internet has to go to reach my LAN), and let's say that the private IP of my "server" is Y.
- So in the Virtual Server section:
I put the User-defined Service Name = SSH, Protocol = TCP, Wan and LAN Open port = 22 and Lan Ip Address = Y (the private Ip address of my notebook running CentOS 24/7, with this Ip Address I can successfully ssh if I'm using a device inside my LAN)
Now, what my logic says is that I should be able to ssh to my notebook with the command ssh user@X
(remember, X is my public Ip), so I try to ssh to my notebook trough https://c9.io/ or first connecting to my university trough ssh and then trying to ssh to my notebook in my home, etc... I always get the same response which is: ssh: connect to host X port 22: Connection timed out
after 30 seconds or something like that...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EDIT3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Is normal that in http://www.canyouseeme.org/ for every port I get this message?
I mean I tried 21, 22, 80, 53, 110, 143, etc... and like other 20 random ports and for each one I get the same response...
Well, at the end it was a problem of the modem-router that my ISP provided me (looking for a lot of time on the internet I found in a forum what is the password that my ISP puts in those models of modem-router and bingo, I could enter to the admin panel) Then I went to Port Filtering section and Port Forward section, let's say I want to connect from port 33734 when I'm outside my home, then in Port Filtering I enabled that port and in Port Fordward I Fordward that port to my router, then in my router in this section:
I put the User-defined Service Name = SSH, Protocol = TCP, Wan Port = 33734 and LAN Open port = 22 and Lan Ip Address = Local IP of my CentOS and then I could SSH to my CentOS trough https://c9.io/, that way I can SSH with default port when I'm home, but for outsiders they need to put another one (in th example I used 33734) Man, it feel so good :D
Ok, it was tricky to find, because apparently that's a Latin-America version (only).
I found the manual on D-Link's Brazilian site.
"Procedimentos para configuração de Redirecionamento de Portas"
(translated: "Procedures for Configuring Port Forwarding")
As suspected, you are to use the "Virtual Server" options.
Google translated from Portuguese to English, with additional notes added:
- Click the Advanced tab > Virtual Server and change the following parameters:
- Select User-defined service name option and enter a name for the the rule.
- Protocol: Select the type of protocol used by the service. If the port uses the TCP and UDP protocols, create a rule for each protocol.
- Port WAN: Enter the port number (to answer on the WAN side).
- Open LAN port: Port number to use on LAN side.
- LAN IP Address: Enter the IP address of the LAN computer hosting the server.
- Click Apply Changes to save the settings.
Keep in mind that this router may not (probably doesn't) support hairpin NAT, so you won't be able to access the forwarded LAN resources from inside the LAN by using the WAN IP address. So to test the forwarding/virtual server setup you'll need to test from a computer that's on the WAN side of the router.