Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Networking - No Route to Host


Gina

Recommended Posts

Not sure if this is the best place to post this but it is DIY kit for astro imaging.

I have Raspberry Pi microcomputer boards to control all my astro imaging systems and will also probably use one for my ROR automation if I can get the reliability.  Mostly these work fine over WiFi (once I've sorted out the bugs) but every now and then I find I cannot connect via Terminal from Linux Mint.  I use SSH to connect, the OS saves previous command lines so I only have to scroll up the list to get my commands.  For instance, I'm currently have difficulty connecting to my all sky camera.  This is what I get.

gina@Mint-Desktop ~ $ ssh gina@asc2
ssh: connect to host asc2 port 22: No route to host
gina@Mint-Desktop ~ $

Or

gina@Mint-Desktop ~ $ ssh gina@192.168.1.78
ssh: connect to host 192.168.1.78 port 22: No route to host
gina@Mint-Desktop ~ $

As can be seen the host IP is recognised but the system says it can't find a route to it.  I've tried rebooting everything including RPi, desktop, and even router but no joy.  I seem to get this every so often and that's the end of any imaging for that night.  Later it just works.  Does anyone have any idea what's going on or any way round the problem?  Any assistance very greatly received.  I'm not very knowledgeable about networking.

Link to comment
Share on other sites

  • Replies 208
  • Created
  • Last Reply

If I connect by Ethernet cable it works.  ATM I can do that because the ASC is on the bench under test.  The WiFi problem isn't signal strength as the RPi is only a few metres from the AP.

Link to comment
Share on other sites

Here is a very very very short tutorial on networking.

In order to connect to particular host, your system needs to know route to that host. Above it says that it does not know that route.

There is simple way for your computer to know a route to any particular host - it's got two options. First is to assume that particular host is in your local network, and second (alternative to first) is to delegate this job to computer on your network that "knows about routing stuff" - your router / gateway - it will "relay the message".

How does your computer differentiate which method to use? From IP address you are trying to access. Every network interface under IPv4 has network address - IP address, but also network mask.

For example, you computer might have network IP something like this 192.168.0.10/24 or another way to write the same thing is 192.168.0.10 / 255.255.255.0

First part is actual address of your computer and second part is important bit - this tells your computer what other IP addresses it should treat as belonging to the same network. In the case I've given this means all addresses in the form of 192.168.0.something belong to your local network and your computer will try to "talk" to them directly.

How do you get these addresses - via net mask, or network mask, like this:

192.168.     0. something

255.255.255.0

Where there is 1 in net mask - that part stays fixed, where there is 0 in net mask - you can put what ever you want in that part and it will be valid address on your sub net. 255 just means 8 ones in binary form. Most net masks in home networks don't use separate bits, but groups of 8 bits. So you can have netmask 255.255.255.0 - meaning first three numbers of IP must stay the same - any number in the last place will belong to your network - for example 192.168.0.1, 192.168.0.2, .... 192.168.0.254 (last one with 255 is broad cast address ...). You can have netmask 255.255.0.0 - this allows for much larger number of IP addresses on your local network, as any combination of last two numbers is allowed.

If your computer is trying to contact IP address that belongs to your network it will try directly on network. If IP given does not belong to your network - your computer will send connection to your gateway - it assumes that gateway will know how to find particular host.

Above is simple routing, things can be much more complicated (like having routing tables, different interfaces for different routes, router-router protocols ...)

Your problem with

connect to host 192.168.1.78 port 22: No route to host

can happen if you try to access 192.168.1.78 from a computer that:

1) has no network interface configured to include 192.168.1.78 on its subnet. Example of interface configured to allow access to above IP would be 192.168.1.2/24 or 192.168.0.2/16

2) it has network interface configured to different subnet, like 192.168.0.0/24 but has no gateway set (and that would mean no internet access).

Can you list your interfaces and their config on your Mint distro? (ifconfig)

Link to comment
Share on other sites

gina@Mint-Desktop ~ $ ifconfig
enp2s0    Link encap:Ethernet  HWaddr 40:8d:5c:e9:18:c8  
          inet addr:192.168.1.79  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::dd:9173:1f3d:49ff/64 Scope:Link
          inet6 addr: fd53:7f53:4e13:0:a444:1adb:d37f:9c64/64 Scope:Global
          inet6 addr: fd53:7f53:4e13:0:7481:897b:ce6e:7987/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:933222 errors:0 dropped:0 overruns:0 frame:0
          TX packets:450647 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1209476038 (1.2 GB)  TX bytes:44137725 (44.1 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:31408 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31408 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:8398313 (8.3 MB)  TX bytes:8398313 (8.3 MB)

gina@Mint-Desktop ~ $ 

 

Link to comment
Share on other sites

This is using the Ethernet connection.

gina@asc2:~$ ifconfig
enxb827ebc3de49 Link encap:Ethernet  HWaddr b8:27:eb:c3:de:49  
          inet addr:192.168.1.226  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd53:7f53:4e13:0:f887:a38d:e7d1:faff/64 Scope:Global
          inet6 addr: fe80::2c04:5a14:875c:57b/64 Scope:Link
          inet6 addr: fd53:7f53:4e13:0:88c5:be6f:bfb4:864f/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:334922 errors:0 dropped:0 overruns:0 frame:0
          TX packets:633617 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17539231 (17.5 MB)  TX bytes:841186556 (841.1 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10138 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:750462 (750.4 KB)  TX bytes:750462 (750.4 KB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:96:8b:1c  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1155 errors:0 dropped:1155 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:342150 (342.1 KB)  TX bytes:0 (0.0 B)

gina@asc2:~$ 

 

Link to comment
Share on other sites

3 minutes ago, Gina said:

This is using the Ethernet connection.

I'm slightly confused here. PI says it's address is now 192.168.1.226 - did you ssh into this address, or you used hostname this time?

Do you run DHCP on your ethernet network (this can explain different ip address)?

Link to comment
Share on other sites

Just now, Gina said:

I presume the different IP is due to using Ethernet rather than WiFi.  The router is showing asc2 assigned to 192.168.1.226.

Ah, ok, you have a router and it handles DHCP - good. I presume your router is also having wifi connectivity that you want to use?

If so, follow this tutorial under "command line" section:

https://www.linux.com/learn/how-configure-wireless-any-linux-desktop

In short, you will need to find ESSID of your router, to do that use:

iwlist wlan0 scan

on your PI.

Next you need your wifi pass, and you need to use this:

iwconfig wlan0 essid NETWORK_NAME key s:WIRELESS_KEY

and last you want to get IP address for your wifi interface by:

dhclient wlan0

 

Link to comment
Share on other sites

 

Shut down ASC using

sudo shutdown -h -P now

Switched off and on again then SSHed as below.

gina@Mint-Desktop ~ $ ssh gina@asc2
gina@asc2's password: 
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.38-v7+ armv7l)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

163 packages can be updated.
0 updates are security updates.

New release '18.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Sun Feb 24 21:13:39 2019 from 192.168.1.79
gina@asc2:~$ 

 

Link to comment
Share on other sites

6 minutes ago, vlaiv said:

Ah, ok, you have a router and it handles DHCP - good. I presume your router is also having wifi connectivity that you want to use?

If so, follow this tutorial under "command line" section:

https://www.linux.com/learn/how-configure-wireless-any-linux-desktop

In short, you will need to find ESSID of your router, to do that use:

iwlist wlan0 scan

on your PI.

Next you need your wifi pass, and you need to use this:

iwconfig wlan0 essid NETWORK_NAME key s:WIRELESS_KEY

and last you want to get IP address for your wifi interface by:

dhclient wlan0

 

I'm using an Access Point connected to the router by Ethernet because the router's own WiFi is very poor.  The router's WiFi is disabled.

Link to comment
Share on other sites

1 minute ago, Gina said:

I'm using an Access Point connected to the router by Ethernet because the router's own WiFi is very poor.  The router's WiFi is disabled.

It should not matter as long as they are properly configured, since you run DHCP on your router and if AP is just bridging things - PI will get address via router DHCP. You can actually run both but you need to be careful to avoid clash in IP ranges and let AP serve only wifi clients, while router only wired clients, but I'm guessing it's working fine as is if you are using your phone via wifi or other devices.

Link to comment
Share on other sites

Just now, Gina said:

gina@asc2:~$  iwlist wlan0 scan 
wlan0     No scan results

gina@asc2:~$ 

 

What does iwconfig return? Do you know essid of your AP - it's the thing that is shown as wireless network - name of wireless network.

Link to comment
Share on other sites

gina@asc2:~$ iwconfig
wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          
enxb827ebc3de49  no wireless extensions.

lo        no wireless extensions.

 

Link to comment
Share on other sites

1 minute ago, Gina said:

Router handles Ethernet and AP handles WiFi only.

That should all be ok as long as we get PI wifi to connect to AP. Try iwlist again but with sudo this time:

sudo iwlist wlan0 scan

Link to comment
Share on other sites

With sudo.  Only the first entry is mine the other are my neighbours.

gina@asc2:~$ sudo iwlist wlan0 scan
[sudo] password for gina: 
wlan0     Scan completed :
          Cell 01 - Address: F0:9F:C2:F4:1B:87
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=66/70  Signal level=-44 dBm  
                    Encryption key:on
                    ESSID:"Ubiquity"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 80ms ago
                    IE: Unknown: 00085562697175697479
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030101
                    IE: Unknown: 050400010000
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1AAC011BFFFFFF0000000000000000000100000000000000000000
                    IE: Unknown: 3D1601080C00000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: Unknown: DD1300156D00010100010227E58106F09FC2F31B87
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
          Cell 02 - Address: 42:8D:36:82:D9:E0
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=16/70  Signal level=-94 dBm  
                    Encryption key:off
                    ESSID:"BTWifi-with-FON"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 80ms ago
                    IE: Unknown: 000F4254576966692D776974682D464F4E
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 050402030000
                    IE: Unknown: 0706474220010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1ABC191BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080400000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD090010180200000C0000
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00
          Cell 03 - Address: 42:8D:36:82:D9:E1
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=17/70  Signal level=-93 dBm  
                    Encryption key:on
                    ESSID:"BTWifi-X"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 80ms ago
                    IE: Unknown: 00084254576966692D58
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 0706474220010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1ABC191BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080400000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD090010180200000C0000
                    IE: WPA Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : 802.1x
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00
          Cell 04 - Address: 48:8D:36:82:D9:E7
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=18/70  Signal level=-92 dBm  
                    Encryption key:on
                    ESSID:"BTHub4-FHNR"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 80ms ago
                    IE: Unknown: 000B4254487562342D46484E52
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 050402030000
                    IE: Unknown: 0706474220010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1ABC191BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080400000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD270050F204104A0001101044000102104700107B6C18C65FB6FB2E5653951DA2F4CA91103C000103
                    IE: Unknown: DD090010180202000C0000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00

gina@asc2:~$ 

 

Link to comment
Share on other sites

sudo iwconfig wlan0 essid Ubiquity key s:WIRELESS_KEY

where WIRELESS_KEY is your wireless password

and after that

sudo dhclient wlan0

and ifconfig in the end to see what IP did we get for wireless interface.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.