I know the problem I am going to mention can be found everywhere, but none of the solutions proposed didn't help so I decided to ask for suggestions that may lead to a solution here, specialised for my issue. Let me firstly describe my issue from the beginning:
I have a laptop which runs Ubuntu 16.04 and in which I have plugged a wifi adapter -so I can have better range from the wifi device that the laptop has- and I want to ssh to a raspberry pi 3 I have, which runs Raspbian Jessie, by using the ssh command. I am generally new to networking, so I have ran all the diagnostic commands that I have found that may show a solution to the issue and still I cannot see what maybe it's wrong. It's important to say that I have checked in both computers the ufw status and it's inactive and in both computers ssh is installed. To be more specific about the diagnostic network commands:
Laptop (Ubuntu 16.04):
I have disabled the laptop's wifi device and I am only using the wifi adapter and I ran:
ifconfig enp8s0 Link encap:Ethernet HWaddr d0:bf:9c:5f:98:af UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:1455 errors:0 dropped:0 overruns:0 frame:0 TX packets:1455 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:140456 (140.4 KB) TX bytes:140456 (140.4 KB) wlo1 Link encap:Ethernet HWaddr d0:7e:35:7c:25:db UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:3523 errors:0 dropped:0 overruns:0 frame:0 TX packets:1525 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:5271276 (5.2 MB) TX bytes:150804 (150.8 KB) wlx000f600587d8 Link encap:Ethernet HWaddr 00:0f:60:05:87:d8 inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::b9:d1f:c83f:cc61/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:115147 errors:0 dropped:0 overruns:0 frame:0 TX packets:61725 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:169777681 (169.7 MB) TX bytes:5747359 (5.7 MB)
I also ran:
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 600 0 0 wlx000f600587d8 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlx000f600587d8 192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlx000f600587d8
Raspberry pi 3 (Raspbian Jessie):
ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:4d:85:d9 inet6 addr: fe80::10be:28c2:7983:36fe/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 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:200 errors:0 dropped:0 overruns:0 frame:0 TX packets:200 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:16656 (16.2 KiB) TX bytes:16656 (16.2 KiB) wlan0 Link encap:Ethernet HWaddr b8:27:eb:18:d0:8c inet addr:192.168.1.49 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::38e3:ead6:9bde:4b47/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:20253 errors:0 dropped:3718 overruns:0 frame:0 TX packets:12845 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16856928 (16.0 MiB) TX bytes:1841638 (1.7 MiB)
and
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
At my laptop I ran:
ssh [email protected]
and I get the following error after 1-2 seconds:
ssh:connect to host 192.168.1.49 port 22: No route to host
I don't know what causes this issue, so I would appreciate your suggestions and answers.
I haven't tested the laptop connection without the wifi adapter because the wifi device on my laptop doesn't work properly. So the adapter is a must, unless I use an ethernet connection between the two computers, but I want to leave this as a final option.
EDIT:
After techraf's comment:
ping 192.168.1.49
PING 192.168.1.49 (192.168.1.49) 56(84) bytes of data.
From 192.168.1.50 icmp_seq=1 Destination Host Unreachable
From 192.168.1.50 icmp_seq=2 Destination Host Unreachable
From 192.168.1.50 icmp_seq=3 Destination Host Unreachable
From 192.168.1.50 icmp_seq=4 Destination Host Unreachable
From 192.168.1.50 icmp_seq=5 Destination Host Unreachable
From 192.168.1.50 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.1.49 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 5999ms
pipe 4
I have also enabled the SSH server on the raspberry, because it was one the first solutions I found from googling my issue.
After Steve Robillard's suggestion:
sudo service ssh status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: active (running) since Mon 2016-12-12 15:48:15 UTC; 1 day 20h ago
Main PID: 545 (sshd)
CGroup: /system.slice/ssh.service
└─545 /usr/sbin/sshd -D
Dec 12 15:48:15 raspberrypi systemd[1]: Started OpenBSD Secure Shell server.
Dec 12 15:48:15 raspberrypi sshd[545]: Server listening on 0.0.0.0 port 22.
Dec 12 15:48:15 raspberrypi sshd[545]: Server listening on :: port 22.
Dec 14 12:36:40 raspberrypi systemd[1]: Started OpenBSD Secure Shell server.
ping 192.168.1.49
. What are the results? Then turn off your Pi (disconnect the power cable) and againping 192.168.1.49
. What are the results?