1

My Pi running Raspbian Stretch stopped being reachable via ssh, so I connected a screen to debug why, after turning it off and on again.

The GUI was all changed with the annoying message that says that Raspbian had been updated and conf files moved to oldconffiles. I hadn't run any upgrades and AFAIK I haven't enabled automatic upgrading.

The wlan0 interface now gets the IP 169.254.196.101, despite it being, to my knowledge, previously configured and working with the static IP 192.168.0.12 for the last months.

I tried to set up a static IP again by editing /etc/dhcpcd.conf as documented in the file:

interface wlan0
static ip_address=192.168.0.12/24

After a reboot, the interface has the desired IP but it cannot reach any other host and cannot be reached.

If I start the GUI, the WiFi reports as connected to my home network. In the router admin panel, the Pi appears as one of the connected devices via WiFi. I removed the static IP configuration and assigned the desired IP to the MAC on the router config. Now, whatever the configuration in dhcpcd.conf, the Pi appears as connected, but I cannot ping the router or any other host. Rebooting or turning wireless off has an effect on the router connected devices, so the list looks reliable.

When connecting with an ethernet cable, everything works normally.

Most search results point me to Jessie answers, which I don't think is helping, but at this point I have reverted all previous attempts.

EDIT(2):

Result of netstat -r. 192.168.0.1 is the IP of my router.

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.18.0.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

Via the GUI network tool I specified the IP again and it shows up in the dhcpcd.conf file with the line:

SSID MYSSIDNAME
inform 192.168.0.12

Output of ip addr (with ethernet cable in):

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:ce:c1:bb brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.19/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::c8ff:b708:f181:8036/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:9b:94:ee brd ff:ff:ff:ff:ff:ff
    inet 169.254.196.101/16 brd 169.254.255.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::4505:f456:75d0:3bfc/64 scope link 
       valid_lft forever preferred_lft forever

When ethernet cable is removed,

Output of ip route with ethernet cable connected, without it only the line for wlan0 is in the output.

default via 192.168.0.1 dev eth0 src 192.168.0.19 metric 202 
169.254.0.0/16 dev wlan0 proto kernel scope link src 169.254.196.101 metric 303 
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.19 metric 202 

This is the output of iw dev wlan0 info (edited SSID and MAC values):

Interface wlan0
    ifindex 3
    wdev 0x1
    addr fe:de:ab:dc:fe:de
    ssid MYSSIDNAME
    type managed
    wiphy 0
    channel 6 (2437 MHz), width: 20 MHz, center1: 2437 MHz
    txpower 31.00 dBm

And this is the output of iw dev wlan0 link (edited too, value for the router MAC is consistent with the output from my laptop):

Connected to 40:0e:11:e1:d1:1a (on wlan0)
    SSID: MYSSIDNAME
    freq: 2437
    RX: 136281 bytes (347 packets)
    TX: 2645360 bytes (44753 packets)
    signal: -42 dBm
    tx bitrate: 72.2 MBit/s

    bss flags:  short-preamble short-slot-time
    dtim period:    1
    beacon int: 100
  • 1
    Can you do a netstat-r and verify output shows a "default" route with the IP of your router on the wlan0 interface? – Tim Campbell Mar 2 at 16:48
  • Edited to add the result of netstat @TimCampbell – Rubén Cabrera Mar 2 at 16:51
  • The "Iface" is wrong. It should read "wlan0". This means that to reach the router, it wants to use the physical Ethernet. This explains why wlan0 can't reach the default router, but it does not explain how it ended up configured to the wrong interface. Have you manually edited network config files? – Tim Campbell Mar 2 at 17:02
  • 1
    Possible duplicate of DNS finds ip but cannot ping address – Milliways Mar 2 at 21:51
  • 1
    @RubénCabrera but the answer is the same - improper static IP setup - you may have other problems (your question is imprecise) but you need to fix the fundamentals first. If you get a Link-local address the Pi cannot find a router. – Milliways Mar 2 at 23:35
0

As far as I can see is, that the wired connection has a DHCP server running so the interface eth0 gets an ip address 192.168.0.19 from it including other options like default route and DNS server addresses. Usually internet home router with wired and wireless connections bridge both and have a DHCP server running. Devices connected to it, no matter what connection is used, are all part of the same subnet, e.g. in your case 192.168.0.0/24. Assuming this I would expect that the RasPi connected by WiFi (wlan0) will also find the same DHCP server than from the wired connection (eth0). It should also get an ip address other than 192.168.0.19 with options from the subnet. This is not the case.

Instead you get a link-local address that is given when no DHCP server is found. Maybe there is no wireless ethernet connection at all.

  • Check if the wired and wireless connection on the router are bridged or if they have different subnets, e.g 192.168.0.0/24 for wired and maybe 192.168.1.0/24 for wireless.
  • Check if you can get an ip address from a DHCP server on the wireless connection.
  • Check your /etc/wpa_supplicant/wpa_supplicant.conf if it still matches all conditions to connect to the router.
  • Check WiFi connection on the RasPi by executing this commands: iw dev wlan0 info and iw dev wlan0 link

Do all checks with unplugged ethernet cable so only the WiFi connection comes to play. Tell us what you find.

  • I don't understand the first point. I can access the router on 192.168.0.1 from wired and wireless. I can get IP addresses from DHCP from any other device at home and the Pi was getting an IP for months. wpa_supplicant.conf has the right information. I'm updating the question with the output of the commands. Thanks. – Rubén Cabrera Mar 3 at 21:45
  • @RubénCabrera Sorry, I have given a wrong example subnet 192.168.0.1/24. It should be 192.168.1.0/24. I have corrected the answer. But about your comment: it is not possible to connect to 192.168.0.1 with an interface address of 169.254.196.101. They are on different subnets. This can only be done with routing, but 169.254.0.0/16 addresses are not routable. Check with ping -I wlan0 192.168.0.1. – Ingo Mar 3 at 21:59
  • Thanks, it is clearer now. Pinging the router or any other address, in the subnet and of known hosts on the internet, fails (100% packet loss). – Rubén Cabrera Mar 3 at 22:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.