1

My Raspi is connected to our WLAN using the following /etc/network/interfaces settings

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    address 192.168.65.227
    netmask 255.255.254.0
    network 192.168.64.0
    broadcast 192.168.65.255
    gateway 192.168.65.254 
    dns-nameservers 192.168.65.21 192.168.65.11

And the following settings in /etc/wpa_supplicant/wpc_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
    ssid="<ssid>"
    psk="<psk>"
    key_mgmt=WPA-PSK
}

With this config, no hostnames are resolved - I suspect because the Pi can't find my local DNS servers (192.168.65.21 and 192.168.65.11). If I change these in the network interfaces file to 8.8.8.8 and 8.8.4.4 then external hostnames are resolved so I can successfully ping google.com (whereas previously only specifying the IP address -- e.g ping 8.8.8.8 -- would work).

If I attempt to ping any local IP addresses, it tells me that the destination host is unreachable; internet works but not local network.

I am also unable to reach the Pi from other machines on my local network. My initial thought was an incorrect subnet mask, but when I run ifconfig it correctly brings through 255.255.254.0

8
  • Why do people pick these random settings and where do they come from?
    – Milliways
    Apr 18, 2017 at 11:16
  • What random settings?
    – ryansin
    Apr 18, 2017 at 11:17
  • @Milliways well that was an unhelpful comment, not what this site is about
    – ryansin
    Apr 18, 2017 at 11:28
  • 1
    I think the point is you seem to have done something cargo cult style and are then perplexed that it doesn't work. There actually is no question here, but it's implicit what you more or less meant to ask is the duplicate.
    – goldilocks
    Apr 18, 2017 at 12:45
  • I don't know why you'd assume that - I wrote this myself and I've set up networking on several Linux distros that have all worked. I included all of this information because I wanted to be clear, not because I don't understand how it works. On the same machine, for instance, eth0 works with a static IP. I think it would be helpful if @Milliways was more clear instead of just criticizing and marking as a duplicate of a generic question that doesn't solve this issue.
    – ryansin
    Apr 18, 2017 at 12:50

0

Browse other questions tagged or ask your own question.