Connect to ssh on machine behind NAT with forwarded port
up vote
0
down vote
favorite
I am struggling with connection to my Raspberry Pi behind NAT in my home from outside.
What I did until now:
- I set in my router DDNS to have access for outside because my ISP giving me dynamic IP (let say it is: external.no-ip.org)
- I set in my router in DHCP static IP (sing MAC address) for my Raspberry Pi (let say it is 192.168.1.155)
- I forwarded port 50022 on my router to port 22 of 192.168.1.155 which is reserved for Raspberry Pi
Next I am trying SSH
ssh pi@external.no-ip.org -p 50022
and I can not connect to SSH.
What I am doing wrong? I have tested and can ping external.no-ip.org and it have my IP. I have tested redirections and for sure 50022 is redirected to 22 on my raspberry PI.
Thank you for help.
BR
Arek
ssh raspberry-pi
|
show 5 more comments
up vote
0
down vote
favorite
I am struggling with connection to my Raspberry Pi behind NAT in my home from outside.
What I did until now:
- I set in my router DDNS to have access for outside because my ISP giving me dynamic IP (let say it is: external.no-ip.org)
- I set in my router in DHCP static IP (sing MAC address) for my Raspberry Pi (let say it is 192.168.1.155)
- I forwarded port 50022 on my router to port 22 of 192.168.1.155 which is reserved for Raspberry Pi
Next I am trying SSH
ssh pi@external.no-ip.org -p 50022
and I can not connect to SSH.
What I am doing wrong? I have tested and can ping external.no-ip.org and it have my IP. I have tested redirections and for sure 50022 is redirected to 22 on my raspberry PI.
Thank you for help.
BR
Arek
ssh raspberry-pi
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
1
pi@externail.no-ip.org
Doesn’t look like a valid hostname -external.no-ip.org
is what you should use. Also, if you useping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?
– barny
Nov 11 at 9:38
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14
|
show 5 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am struggling with connection to my Raspberry Pi behind NAT in my home from outside.
What I did until now:
- I set in my router DDNS to have access for outside because my ISP giving me dynamic IP (let say it is: external.no-ip.org)
- I set in my router in DHCP static IP (sing MAC address) for my Raspberry Pi (let say it is 192.168.1.155)
- I forwarded port 50022 on my router to port 22 of 192.168.1.155 which is reserved for Raspberry Pi
Next I am trying SSH
ssh pi@external.no-ip.org -p 50022
and I can not connect to SSH.
What I am doing wrong? I have tested and can ping external.no-ip.org and it have my IP. I have tested redirections and for sure 50022 is redirected to 22 on my raspberry PI.
Thank you for help.
BR
Arek
ssh raspberry-pi
I am struggling with connection to my Raspberry Pi behind NAT in my home from outside.
What I did until now:
- I set in my router DDNS to have access for outside because my ISP giving me dynamic IP (let say it is: external.no-ip.org)
- I set in my router in DHCP static IP (sing MAC address) for my Raspberry Pi (let say it is 192.168.1.155)
- I forwarded port 50022 on my router to port 22 of 192.168.1.155 which is reserved for Raspberry Pi
Next I am trying SSH
ssh pi@external.no-ip.org -p 50022
and I can not connect to SSH.
What I am doing wrong? I have tested and can ping external.no-ip.org and it have my IP. I have tested redirections and for sure 50022 is redirected to 22 on my raspberry PI.
Thank you for help.
BR
Arek
ssh raspberry-pi
ssh raspberry-pi
asked Nov 11 at 7:36
ArekS
213
213
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
1
pi@externail.no-ip.org
Doesn’t look like a valid hostname -external.no-ip.org
is what you should use. Also, if you useping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?
– barny
Nov 11 at 9:38
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14
|
show 5 more comments
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
1
pi@externail.no-ip.org
Doesn’t look like a valid hostname -external.no-ip.org
is what you should use. Also, if you useping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?
– barny
Nov 11 at 9:38
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
1
1
pi@externail.no-ip.org
Doesn’t look like a valid hostname - external.no-ip.org
is what you should use. Also, if you use ping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?– barny
Nov 11 at 9:38
pi@externail.no-ip.org
Doesn’t look like a valid hostname - external.no-ip.org
is what you should use. Also, if you use ping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?– barny
Nov 11 at 9:38
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14
|
show 5 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
the easy way would be to simply install dataplicity on your pi, they let you use one pi for free, its basically a ssh service that lets you access your pi over the internet.
are you able to access the pi using the ddns from within your network, i have used ssh on many linux computers like this and never had a problem oh and it could also be that your isp is blocking it.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
the easy way would be to simply install dataplicity on your pi, they let you use one pi for free, its basically a ssh service that lets you access your pi over the internet.
are you able to access the pi using the ddns from within your network, i have used ssh on many linux computers like this and never had a problem oh and it could also be that your isp is blocking it.
add a comment |
up vote
0
down vote
the easy way would be to simply install dataplicity on your pi, they let you use one pi for free, its basically a ssh service that lets you access your pi over the internet.
are you able to access the pi using the ddns from within your network, i have used ssh on many linux computers like this and never had a problem oh and it could also be that your isp is blocking it.
add a comment |
up vote
0
down vote
up vote
0
down vote
the easy way would be to simply install dataplicity on your pi, they let you use one pi for free, its basically a ssh service that lets you access your pi over the internet.
are you able to access the pi using the ddns from within your network, i have used ssh on many linux computers like this and never had a problem oh and it could also be that your isp is blocking it.
the easy way would be to simply install dataplicity on your pi, they let you use one pi for free, its basically a ssh service that lets you access your pi over the internet.
are you able to access the pi using the ddns from within your network, i have used ssh on many linux computers like this and never had a problem oh and it could also be that your isp is blocking it.
answered Nov 11 at 8:43
doctor
13
13
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246737%2fconnect-to-ssh-on-machine-behind-nat-with-forwarded-port%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
For the ssh response to arrive back the private IP should be SNATed a.k.a MASQUERADE
– Nizam Mohamed
Nov 11 at 7:42
1
pi@externail.no-ip.org
Doesn’t look like a valid hostname -external.no-ip.org
is what you should use. Also, if you useping external.no-ip.org
does the hostname resolve to the correct IP address (of the WAN side of your router)?– barny
Nov 11 at 9:38
Oh actually the other problem is going to be that you are mapping external port 50022 to pi port 22 - try making both port numbers the same port 22 or port 50022, if necessary changing your ssh service to use port 50022 (simplest to first try making the external port 22). Also, change one thing at a time and retest because if you change two things you won’t know which thing fixed the problem.
– barny
Nov 11 at 9:41
And make sure your pi firewall is allowing incoming on port 22 - you can check this on your local network.
– barny
Nov 11 at 9:42
Hi @barny, thank you for your suggestions. I am sorry, to fast pressed Enter. Will write full answer bellow.
– ArekS
Nov 11 at 11:14