I am trying to access Pi (ip: 192.168.11.20) using ssh via wifi (ap at 192.168.11.1) by another linux box (ip: 192.168.11.2). But it failed with the message:
ssh: connect to host 192.168.11.20 port 22: No route to host
It seems there is some problems on the route setup. Somehow the package can not be routed between Pi and linux box (as shown by the nmap
output). Any comment is appreciated!
Here are the output of route -n
on Pi (192.168.11.20)
Kernel IP routing table
Destination Gateway Genmask Flags Mestric Ref Use Iface
0.0.0.0 192.168.11.1 0.0.0.0 UG 0 0 0 wlan0
0.0.0.0 192.168.11.1 0.0.0.0 UG 303 0 0 wlan0
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.11.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
and the ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:35:8b:e4
inet6 addr: fe80::c39:5688:cd46:2d9f/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:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:528 (528.0 B) TX bytes:528 (528.0 B)
wlan0 Link encap:Ethernet HWaddr 30:5a:3a:62:73:e5
inet addr:192.168.11.20 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::326a:3aff:fe62:73e5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45 errors:0 dropped:3 overruns:0 frame:0
TX packets:97 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6766 (6.6 KiB) TX bytes:15543 (15.1 KiB)
and finally the nmap 192.168.11.*
(192.168.11.2 is missing)
Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-16 23:33 CST
Nmap scan report for 192.168.11.1
Host is up (0.057s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
Nmap scan report for 192.168.11.20
Host is up (0.00047s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
22/tcp open ssh
Nmap done: 256 IP addresses (2 hosts up) scanned in 5.03 seconds
On the other hand route -n
from linux box (192.168.11.2)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.11.1 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.11.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
and ifconfig
eth0 Link encap:Ethernet HWaddr 00:23:18:26:1c:85
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)
Interrupt:20 Memory:d4700000-d4720000
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:23143 errors:0 dropped:0 overruns:0 frame:0
TX packets:23143 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3462530 (3.4 MB) TX bytes:3462530 (3.4 MB)
wlan0 Link encap:Ethernet HWaddr 00:27:10:01:eb:98
inet addr:192.168.11.2 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::227:10ff:fe01:eb98/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:143189 errors:0 dropped:0 overruns:0 frame:0
TX packets:124849 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88955604 (88.9 MB) TX bytes:20473398 (20.4 MB)
and finally nmap 192.168.11.*
(192.168.11.20 is missing)
Starting Nmap 5.21 ( http://nmap.org ) at 2015-12-16 23:40 CST
Nmap scan report for 192.168.11.1
Host is up (0.032s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
Nmap scan report for 192.168.11.2
Host is up (0.00028s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
Nmap done: 256 IP addresses (2 hosts up) scanned in 14.59 seconds
EDIT: Additional information on network setup
This is the content of /etc/network/interface
on Pi
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "my_wifi_id"
wpa-psk "my_passwd"
Other information
When I connect Pi to router directly via ethernet port, ssh from linux box to Pi works flawlessly. Also, I can connect to Pi via wifi from external network if I configure ip forwarding on the router to redirect incoming port (e.g. 2200) to port 22 at Pi's address (in this case 192.168.11.20).
Destination Host Unreachable
. But strangely, both ip can ping8.8.8.8
and access internet normally.auto eth0
to your/etc/network/interfaces
even though I doubt it will solve your issue. On my router I can isolate wifi from the rest of the network ... maybe that's the case with you too?