1

Since updating the packages on my Pi3, on reboot my Pi 3 has access to my home network via wlan0, but not to the internet.

The response to "route -n" is

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use   Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0

I can access the internet until the next reboot by entering

pi@raspberrypi:~ $ sudo route add default gw 192.168.1.1

now my routing table is as follows:

pi@raspberrypi:~ $ 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
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0

My /etc/network/interfaces file seems fine, other than what appears to a superfluous set of entries for wlan1.

pi@raspberrypi:~ $ sudo more /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
   dns-nameservers 8.8.8.8 8.8.4.4
   gateway 192.168.1.1

allow-hotplug wlan1
iface wlan1 inet manual
   wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
   dns-nameservers 8.8.8.8 8.8.4.4
   gateway 192.168.1.1

What is really is odd is that, I had to add the gateway entries manually, and that solved the problem. Until I used apt to update my system to the latest versions of all the installed packages, since when the gateway entries appear to be ignored.

Can anyone explain to me what I'm doing wrong?

Chetan Bhargava
  • 1,252
  • 3
  • 15
  • 29

3 Answers3

1

Either you follow the default setup that is made for noobs and is working out of the box or you make your own setup with modifying /etc/network/interfaces. But then you have to know what you are doing. Because you asked for understanding mixing up old style Debian ifupdown and dhcpcd you should look at Differences between /etc/dhcpcd.conf and /etc/network/interfaces?.

Ingo
  • 42,961
  • 20
  • 87
  • 207
1

I managed to find the solution. It appears that the /etc/dhcpcd.conf file (automatically generated - I had never even looked at it) had 3 entries for the SSID of my wireless network. The first 2 contained the line "static routers =" and only the third entry included its ip address. I edited the file to remove the first 2 entries and now everything works just fine.

I'd like to understand how such a thing can happen - this system is supposed to be for noobs to computing (which I definitely am not) who wouldn't stand a chance of finding an issue like this.

0

No one can be sure what is going wrong. The interfaces file warns "Please note that this file is written to be used with dhcpcd", and while you are not using static it probable implies other settings as well.

manual indicates that IP is being set by an external program.

You should try a normal network setup.

How to set up networking/WiFi

Milliways
  • 62,573
  • 32
  • 113
  • 225