2

I have trouble getting my gateway address to reach internet on my Raspberry Pi.

I tried on 2 distinct company networks.

On first network there is no problem, every device can get his network configuration through DHCP.

On second network, Raspberries can not get their gateway address. However they get their IP addresses. On other devices (a Windows 10 or a Linux Ubuntu laptop for example) their is no trouble and everything works perfectly. I tried on my main Raspbian install but also on a fresh install of a newer version. I also tried on 2 distinct Raspberries and the result are the same.

Is there any mean to force DHCP or have you any other solution ?

(When I add my gateway address manually it works perfectly, but I can't handle this solution because I won't have any information about networks where my product is deployed)

Edit :

  1. I use a Raspberry Pi 3b+
  2. The problem happens also on a fresh new install of Raspbian Buster.
  3. Here is my routing table at boot : enter image description here

I have the feeling the first line in this routing table is bad. When I use this command:

route add default gw 192.168.60.200 eth0

It adds the corresponding line to routing table and internet starts working.

Mats Karlsson
  • 979
  • 5
  • 11

1 Answers1

0

If the routing table is on a fresh flashed unmodified Raspberry Pi OS based on Debian Buster then you do not get a default gateway address from the remote DHCP server. The first line in the routing table is not a problem. It is a valid route to network 172.16.0.0/16 behind gateway 192.168.60.254, so you can connect to devices on this network.

Because Ubuntu and MS Window$ get the default gateway 192.168.60.200 on network 192.186.60.0/24 it may be possible that default dhcpcd on the RasPi has a setting that the DHCP server does not understand. To check this you can try to use another networking system. If you like you can use systemd-networkd for testing. How to do it, look at Use systemd-networkd for general networking and follow section ♦ Create interface file for a wired connection.

Ingo
  • 42,961
  • 20
  • 87
  • 207