Ssh: connect to host "xxx.xxx.xxx.xxx" port 22: Connection refused

Hi i am using apalis imx6 board, i am using GSM module on board and also able to configure ppp after running command “pppd call gprs&” and “route add default dev ppp0” i am able to get ppp0 IP by “ifconfig” and also when i do “ping google.com” from board it works.

also i am able to ping that IP via different networks e.g. imx6(vodafone GSM network) and laptop(via mobile hotspot) but when i try to do ssh root@ip from my laptop it shows

ssh: connect to host “xxx.xxx.xxx.xxx” port 22: Connection refused
i am able to do local ssh connection via Ethernet but when i wanted access my board by a different networks please let me know if i wanted to do some more changes.

What exact hardware and software versions of things are you talking about?

Did you already look at the trouble shooting section of the following article on our developer website?

https://developer.toradex.com/knowledge-base/ssh

@rohit.maniwal@bitmapper.com , when GSM module is used, imx6 mostly will get private IP e.g. for ppp0 interface, you check the IP by ifconfig ppp0 to see if it is private ip address.
If so, you may not be able to connect imx6 with ssh root@ip . Because your device is behind NAT. VPN can be used for such case.

@benjamin.tx thanks for reply…how to configure VPN so that i can access my board via ssh

@rohit.maniwal@bitmapper.com , sorry, I attached wrong link. You can find how to deploy OpenVPN here.

Sorry, I attached wrong link. you can find how to deploy OpenVPN here.

before deploying VPN, you should check if IP address for ppp0 is private one.

yes @benjamin.tx by “ifconfig ppp0” i am getting IP’s in the range of 10.0.0.0 – 10.255.255.255 so they are private right…so i m deploying VPN.
is this settings is sufficient to access toradex board remotely…and any specific commands to access toradex remotely via openVPN
thank-you

When VPN is set up including server and client, imx6 and your PC will have a network interface within the same network e.g. 10.8.0.0/24.

hi @benjamin.tx i have a doubt that is this applicable for operating toradex from ubuntu via two different networks…e.g.
ubuntu14.04(mobile internet) and toradex(vodafone internet) by using openVPN…

Hi @rohit.maniwal@bitmapper.com , you need a server with public IP address from ISP. Then deploy OpenVPN client on both ubuntu and toradex SoM. These two clients will connect to this server via OpenVPN and they will be assigned with IP address within same network. For your case, ubuntu uses mobile internet and toradex SoM uses vodafone internet. They will default get private address. So it is impossible to connect between them directly as they are behind NAT. That is why an server with public IP is required. You can apply it from Goolgle or Amazon.

hi @benjamin.tx ,as you said according to current situation i cannot access both due to private IP’s…i have one more query that, is it possible to use one Non-NAT internet(ubuntu-side) and one NAT(toradex-side)…so that i can create one openVPN server on our-side and can access our toradex remotely.
else if this is not possible then we should go for Google/Amazon for server’s

Hi @rohit.maniwal@bitmapper.com , if your ubuntu has non-NAT network and toradex SoM can ping it successfully, then it is okay to deploy OpenVPN server on it.

@benjamin.tx no i am not able to ping toradex SoM(NAT network) by our non-NAT network(from Ubuntu)…but when i connect my ubuntu with mobile hotspot(NAT-network) i can ping toradex

Hi, @rohit.maniwal@bitmapper.com

no i am not able to ping toradex SoM(NAT network) by our non-NAT network(from Ubuntu).
How about the non-NAT of Ubuntu, is it public IP address?
but when i connect my ubuntu with mobile hotspot(NAT-network) i can ping toradex
Who provide this hotspot? Is it vodafone? Is it the same network with SoM? Could you show me IP address of ubuntu and SoM for this case?

Hi @benjamin.tx

i have two internet connection on Ubuntu-side

  1. Broadband(Static Public-Ip 182.73.250.xx)
  2. Mobile-Internet(Hotspot just for testing purpose, i get External IP 49.35.203.94(dynamic) using “curl ipinfo.io/” and local IP 192.168.43.xx).

and on toradex-side i have
1 GSM SoM module(Vodafone with Private-IP 10.81.113.165(Dynamic) by using “ifconfig ppp0”)

Please Note Toradex and Ubuntu are always in different network.

Testing analysis :-

  1. When i connect my ubuntu with Broadband i can not ping toradex.
  2. when i connect my ubuntu with mobile internet(via hotspot) i can ping toradex
  3. toradex can ping to our Internet broadband(182.73.250.xx)

So in the 3rd case if toradex can ping our broadband then is it possible to access toradex.

@rohit.maniwal@bitmapper.com , because SoM has private ip e.g. 10.81.113.165 and it is behind NAT. Theoretically it should not be accessible from other network even with your hotspot. For this I can’t explain now. Maybe hotspot’s carrier is also vodafone, they have internal routing policy for private ip. You can use traceroute -n 10.81.113.165 on Ubuntu via hotspot to find detailed routing. For 3rd case, you have public IP 182.73.250.xx and SoM should ping it successfully. Broadband’s ISP is the one other than vodafone if I am right. You are not able to ping toradex SoM from Ubuntu with broadband internet. Now you can set up OpenVPN server on Ubuntu with broadband network. VPN client on Toradex SoM connects to 182.73.250.xx. When OpenVPN is deployed on both server and client and connected successfully, network with private IP e.g. 10.8.0.X will be created on SoM. You can login to SoM from Ubuntu via 10.8.0.X of SoM.

@benjamin.tx

yes exactly

For 3rd case, you have public IP 182.73.250.xx and SoM ping it successfully. Broadband’s ISP is the one other than vodafone if I am right. You are not able to ping toradex SoM from Ubuntu with broadband internet

so i have to configure openVPN server on ubuntu 14.04 with the help of my internet broadband and also i need to do changes according to
openVPN link text .
Are this changes are enough or i need to do some more.
Also i did some search related to IP’s i come to know that as i use vodafone sim they also provide vodafone m2m(special business sim for IOT products) sim where i will get public ip.
So do you have any idea on this like does it support in our GSM SoM module

Hi @rohit.maniwal@bitmapper.com , for m2m support, I have no idea about it. You may consult GSM module provider and Vodafone.

yes…@benjamin.tx