I have my Pi2 recently configured and run into some networking problems. When I tried setting Pi2's IP address to a static IP (192.168.1.200 in this case), upon newly starting up, it can already reach the outside network (e.g. can ping 8.8.8.8). However, Pi2 remains unreachable from other machines from within my home network, i.e. when my Pi2 address is 192.168.1.200:
$ ping 192.168.1.200
Pinging 192.168.1.200 with 32 bytes of data:
Reply from 192.168.1.111: Destination host unreachable.
Reply from 192.168.1.111: Destination host unreachable.
Reply from 192.168.1.111: Destination host unreachable.
Reply from 192.168.1.111: Destination host unreachable.
Ping statistics for 192.168.1.200:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
The weird phenomenon that I don't totally understand is, if I initiate by doing a ping from my Pi2 to my other home computer, i.e. from Pi2 do a ping 192.168.1.111
, the other home computer is reachable by ping from Pi2. And then, my other home computer can reach Pi2 afterwards, with ping and ssh, etc. This is very inconvenient because I want to remotely access my Pi2 for my use, and I don't want to write a script to find out and then initiate ping to every existing IP addresses within the home address.
My home ISP router is at 192.168.1.1, here is my /etc/network/interfaces
:
source-directory /etc/network/interfaces.d
## no files in the above directory
auto lo
iface lo inet loopback
allow-hotplug eth0
## eth0 not plugged in
iface eth0 inet dhcp
allow-hotplug wlan0
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4
wpa-ssid "MY SSID"
wpa-psk "my psk"
Here is my /etc/dhcpcd.conf
:
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
####################
# EDITA IP STATICA #
####################
interface wlan0
static ip_address=192.168.1.200/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
Output from sudo 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 0 0 0 wlan0
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
Pi2's /etc/resolv.conf
:
# Generated by resolvconf
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
Please let me know your suggestions to find out the source of problem. Thanks in advance.
192.168.1.111
? What is its routing configuration? How are "other machines from within my home network" configured? – techraf Feb 15 '16 at 13:32Connection-specific DNS Suffix . : localdomain Link-local IPv6 Address . . . . . : fe80::b156:405e:5f30:c9f7%2 IPv4 Address. . . . . . . . . . . : 192.168.1.111 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1
They share the same router and subnet mask.
– menuhin Feb 15 '16 at 23:50destination host unavailable
? – techraf Feb 16 '16 at 00:31