pmmcmullen94
Posts: 2
Joined: Fri Jan 05, 2018 4:57 pm

[SOLVED] No default gateway/internet access from Eth0 (Raspbian Stretch)

Fri Jan 05, 2018 5:05 pm

I'm having issues connecting to the internet via eth0 on raspbian stretch. I can connect and ping LAN devices (connected via SSH/VNC on our local network) but any attempts to apt-get or ping external destinations give me "network unreachable errors". I had this issue before and had to add a default gateway to fix it but it should be doing this on it's own through our DHCP server. My local Windows machine on the same network shows no default gateway either for the record. Network configuration/troubleshooting is one area I'm somewhat weak in still so please excuse any errors.

The only step I've taken so far is to disable ipv6. Our network is all Windows, including our DHCP server so if there are any settings we should check please let me know. I'm the only one here that knows anything about Linux so everyone else is stumped :?

Here is the output from sudo systemctl status dhcpcd.service:

Code: Select all

● dhcpcd.service - dhcpcd on all interfaces
   Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-01-05 16:49:41 UTC; 50s ago
  Process: 343 ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -b (code=exited, status=0/SUCCESS)
 Main PID: 360 (dhcpcd)
   CGroup: /system.slice/dhcpcd.service
           ├─360 /sbin/dhcpcd -q -b
           └─450 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext

Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: using IPv4LL address 169.254.55.238
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding route to 169.254.0.0/16
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding default route
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: leased 192.168.12.122 for 691200 seconds
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding route to 192.168.0.0/20
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding route to 10.1.0.0/16 via 192.168.12.4
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding route to 10.19.0.0/16 via 192.168.12.4
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: adding route to 10.20.0.0/16 via 192.168.12.4
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: deleting default route
Jan 05 16:49:54 CoordinatorSandbox dhcpcd[360]: eth0: deleting route to 169.254.0.0/16
Output from route:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.0.0        192.168.12.4    255.255.0.0     UG    202    0        0 eth0
10.19.0.0       192.168.12.4    255.255.0.0     UG    202    0        0 eth0
10.20.0.0       192.168.12.4    255.255.0.0     UG    202    0        0 eth0
192.168.0.0     0.0.0.0         255.255.240.0   U     202    0        0 eth0
And output from ifconfig:

Code: Select all

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.12.122  netmask 255.255.240.0  broadcast 192.168.15.255
        ether b8:27:eb:3e:87:5f  txqueuelen 1000  (Ethernet)
        RX packets 16006  bytes 1011681 (987.9 KiB)
        RX errors 0  dropped 131  overruns 0  frame 0
        TX packets 14189  bytes 16185923 (15.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 13  bytes 684 (684.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 684 (684.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Thanks in advance!

UPDATE: I had our network admin take a look at the DHCP server and it looks like it was setup to provide classless static routes. Once we removed it, the Raspberry grabbed the default gateway with no issue on startup. We followed this answer as well https://askubuntu.com/a/873883 and changed the following in /etc/dhcpcd.conf

Code: Select all

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
to

Code: Select all

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
#option classless_static_routes

Kreacher
Posts: 3
Joined: Sun Apr 08, 2018 11:21 pm

Re: [SOLVED] No default gateway/internet access from Eth0 (Raspbian Stretch)

Sun Jul 08, 2018 11:56 pm

Thanks for the post and the update - I had the same issue - not sure why this isn't causing a problem to more people.

pcmanbob
Posts: 5276
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: [SOLVED] No default gateway/internet access from Eth0 (Raspbian Stretch)

Mon Jul 09, 2018 6:16 am

Kreacher wrote:
Sun Jul 08, 2018 11:56 pm
Thanks for the post and the update - I had the same issue - not sure why this isn't causing a problem to more people.
Probably because most people are using the pi on a home network that does not have the same setup as the DHCP server on the network that pmmcmullen94 was trying to connect his pi to.

The problem was not with the pi its self but the DHCP server on the network, in the examples on askubuntu.com , changes were made to the Windows DHCP server in the first case and to the pi that was set up as the DHCP sever in the second case.

pmmcmullen94 states " I had our network admin take a look at the DHCP server " again the server on the network not the pi.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

Kreacher
Posts: 3
Joined: Sun Apr 08, 2018 11:21 pm

Re: [SOLVED] No default gateway/internet access from Eth0 (Raspbian Stretch)

Mon Jul 09, 2018 9:43 am

Thanks for reminding. I should have mentioned that I am on a home network with a Plusnet "Hub One" router (rebadge of BT HH5). Have been for years, with 10+ RPi working fine. The issue seems to be since the last (June) Stretch update.

The fix to /etc/dhcpcd.conf mentioned by pmmcmullen94 did not resolve my issue, but led me to switch my DHCP server from the router to a NAS unit, and suddenly, no more problem. This could be a one-off, will update the thread if I get any further clarity.

locosantos
Posts: 1
Joined: Tue Jul 24, 2018 9:58 pm

Re: [SOLVED] No default gateway/internet access from Eth0 (Raspbian Stretch)

Tue Jul 24, 2018 10:09 pm

Hi all, I have the same error and I found this article that solved my problem, basicly the problem is in the /etc/resolv.conf, before doing the change in dhcpcd you must save the ip adress that show the actual resolv.conf.

this is the link

http://www.circuitbasics.com/how-to-con ... net-cable/

I hope it helps you!

I'm sorry for my English :)

Return to “Troubleshooting”