1

(I'm not a Super User regular, so please excuse me if I'm not asking this home-networking question in the right place - I picked here over Network Engineering or Server Fault based on this answer)

I have a Raspberry Pi 4 that is connected to my router via an Ethernet cable, and that is also connected to the Wi-Fi network. I would prefer to use the Ethernet connection since it will (presumably?) be faster and more stable. However, the eth0 interface is not accessible, and I think that's because it's not having an LAN IP address assigned correctly via DHCP.

My router is configured to provide IP addresses in the range 192.168.42.0 / 255.255.255.0:

DHCP configuration

The wlan0 interface has an IP address in that range, but the eth0 interface does not:

$ ip addr
[...]
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:57:f1:ee brd ff:ff:ff:ff:ff:ff
    inet 169.254.195.99/16 brd 192.168.42.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::4b37:1a72:26a4:5abb/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 dc:a6:32:57:f1:ef brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.95/24 brd 192.168.42.255 scope global dynamic noprefixroute wlan0
       valid_lft 40794sec preferred_lft 29994sec
    inet6 fe80::bf5f:ba1c:f4b2:f427/64 scope link
       valid_lft forever preferred_lft forever
[...]

but the IP address for eth0 is unusable...

# Executed from another machine on the network
$ ping 169.254.195.99
PING 169.254.195.99 (169.254.195.99): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
^C
--- 169.254.195.99 ping statistics ---
5 packets transmitted, 0 packets received, 100.0% packet loss
$ ssh [email protected]
ssh: connect to host 169.254.195.99 port 22: No route to host
$ ping 192.168.42.95
PING 192.168.42.95 (192.168.42.95): 56 data bytes
64 bytes from 192.168.42.95: icmp_seq=0 ttl=64 time=2.424 ms
64 bytes from 192.168.42.95: icmp_seq=1 ttl=64 time=2.580 ms
64 bytes from 192.168.42.95: icmp_seq=2 ttl=64 time=77.418 ms
^C
--- 192.168.42.95 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.424/27.474/77.418/35.316 ms
$ ssh [email protected]
[successful connection]

...and an attempt to fetch a new address for the eth0 interface fails:

# Executed from the Raspberry Pi
$ sudo dhclient eth0 -v
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/dc:a6:32:57:f1:ee
Sending on   LPF/eth0/dc:a6:32:57:f1:ee
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

I don't want to try running sudo dhclient wlan0 -v to compare, in case that misconfigures the wlan0 interface and prevents me from connecting to the Pi at all.

I suspect that DHCPDISCOVER on eth0 to 255.255.255.255 is incorrect - I think the broadcast address for eth0's DHCPDISCOVER should be 192.168.42.255 - but I don't know how to force that. I don't think anything in dhclient.conf is preventing that:

$ cat /etc/dhcp/dhclient.conf
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#   man page for more information about the syntax of this file
#   and a more comprehensive list of the parameters understood by
#   dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#   not leave anything out (like the domain name, for example), then
#   few changes must be made to this file, if any.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;

#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

#alias {
#  interface "eth0";
#  fixed-address 192.5.5.213;
#  option subnet-mask 255.255.255.255;
#}

#lease {
#  interface "eth0";
#  fixed-address 192.33.137.200;
#  medium "link0 link1";
#  option host-name "andare.swiftmedia.com";
#  option subnet-mask 255.255.255.0;
#  option broadcast-address 192.33.137.255;
#  option routers 192.33.137.250;
#  option domain-name-servers 127.0.0.1;
#  renew 2 2000/1/12 00:00:01;
#  rebind 2 2000/1/12 00:00:01;
#  expire 2 2000/1/12 00:00:01;
#}
1
  • Its too late to help think, but DHCPDISCOVER on 255.255.255.255 is correct, thats definitely not the issue. Have you tried assigning a static ip address ? Changed the cable ? Changed port on the router ? Check all settings in your router that it isnt blocking your lan adapter on mac or something similar ?
    – Silbee
    Commented Oct 17, 2021 at 23:20

0

You must log in to answer this question.

Browse other questions tagged .