cancel
Showing results for 
Search instead for 
Did you mean: 

TP-Link Archer AC750 port forwarding SSH connections using non-standard port

m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

TP-Link Archer AC750 port forwarding SSH connections using non-standard port

I have recently purchased a TP-Link AC750 router and I'm using ,y old plusnet router in bridge mode (thanks to useful information found in this forum).

I am trying to run SSH on a machine on my local WAN. Port forwarding works fine (i.e. I can SSH into the local machine) when I open port 22. However, when I try to run SSH on another port, attempts to connect to the machine times out - and it looks like the port is not open (I can't see it when I use the service canyouseeme.org).

 

Does anyone know how I can configure port forwarding on the TP-Link AC50 router, so that I can run SSH on a non standard port?

20 REPLIES 20
SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Assuming you are using "Forwarding -> Virtual Servers", what happens if you add an entry like

  • Service Port  = 22000
  • Internal Port = 22
  • IP Address = 192.168.x.x - The IP address of the PC running the service application.
  • Protocol = ALL
  • Status = ENABLED
  • Common Service Port = "--- select one--"

http://www.tp-link.com/en/faq-72.html

http://www.tp-link.com/en/faq-742.html

Ex - Plusnet Customer (2009 - 2023) now with BT
m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Hello, thanks for your quick response. I tried the parameters you provided, but the connection still times out (using http://canyouseeme.org).

m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

BTW, I am running the SSH daemon on the non standard port, so I'm not sure your suggestion would have worked, although I suppose the first check/test is to see whether the port was open in the first place.

SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

So you set the internal port to your SSH nonstandard port?

Ex - Plusnet Customer (2009 - 2023) now with BT
m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Actually, no. I left it blank - as it says that if the field is left blank, the same port number is used for the internal port

SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Might be worth a try setting it, it won't harm it as it's not working yet Smiley

Does the SSH work on the local IP address?

Ex - Plusnet Customer (2009 - 2023) now with BT
m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

The field is actually auto populated (to match the external port number) if left blank.

 

Interestingly though,I can't SSH to the computer using the non standard port (I should have thought of trying this first).

 

I have checked using ps and telnet and netstat, to confirm that sshd is indeed running on the specified port, so I have NO idea as to what is causing this problem...

m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

BTW, my laptop is connected to the LAN via WiFi, not a physical cable (I don't know if thats the reason I couldn't ssh into the desktop machine - even though their both on the same LAN).

SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Assuming it's Linux based, is something in the iptables blocking access to that port? 

Ex - Plusnet Customer (2009 - 2023) now with BT
m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

I ran sudo iptables -L | grep <port number>

 

No rule exists for that port. So no, no IP table rules relate to that port. There must be something wrong, I just can't put my finger on it..

SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Anything in the log files to even show an attempt to connect to the sshd port?

Ex - Plusnet Customer (2009 - 2023) now with BT
m0rphe0us
Dabbler
Posts: 13
Registered: ‎05-08-2016

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Thanks for trying to help. This is getting more intricate than I thought ...

 

Here are the last lines of /var/log/auth.log:

707 Aug 6 13:17:03 jupiter sudo: morpheous : TTY=pts/14 ; PWD=/home/morpheous ; USER=root ; COMMAND=/bin/grep sshd.*Failed /v
2708 Aug 6 13:17:03 jupiter sudo: pam_unix(sudo:session): session opened for user root by morpheous(uid=0)
2709 Aug 6 13:17:04 jupiter sudo: pam_unix(sudo:session): session closed for user root

 

HTH

SpendLessTime
Hero
Posts: 3,000
Thanks: 928
Fixes: 86
Registered: ‎21-09-2009

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Depending on which Linux distro you're using, this may work (if your distro uses systemd)

journalctl _COMM=sshd -f -n 100
Ex - Plusnet Customer (2009 - 2023) now with BT
MJN
Pro
Posts: 1,318
Thanks: 161
Fixes: 5
Registered: ‎26-08-2010

Re: TP-Link Archer AC750 port forwarding SSH connections using non-standard port

Try SSHing to localhost on the alternative port and only if that works start to work outwards...