5

I have a Raspberry Pi running Raspbian, connected to a PC via its ethernet NIC and set to DHCP. /etc/network/interfaces on the Pi:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

You're safe to ignore the wifi settings as there are currently no interfaces connected. On the Debian PC, I have isc-dhcp-server installed and configured. The Pi connects to eth0, which is assigned a static IP. dhcpd starts without problems, but in /var/log/syslog I get

May 14 16:53:06 danah dhcpd: DHCPDISCOVER from b8:27:eb:f9:54:da (raspberrypi) via eth0
May 14 16:53:06 danah dhcpd: DHCPOFFER on 192.168.1.2 to b8:27:eb:f9:54:da (raspberrypi) via eth0
May 14 16:53:20 danah dhcpd: DHCPDISCOVER from b8:27:eb:f9:54:da (raspberrypi) via eth0
May 14 16:53:20 danah dhcpd: DHCPOFFER on 192.168.1.2 to b8:27:eb:f9:54:da (raspberrypi) via eth0

and so on, repeatedly. I can't ping the Pi with the IP offered. dhcpdump -i eth0 gives

  TIME: 2015-05-14 16:53:20.960
    IP: 0.0.0.0 (b8:27:eb:f9:54:da) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 897ed007
  SECS: 46
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:f9:54:da:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  50 (  4) Request IP address        192.168.1.2
OPTION:  12 ( 11) Host name                 raspberrypi
OPTION:  55 ( 13) Parameter Request List      1 (Subnet mask)
                         28 (Broadcast address)
                          2 (Time offset)
                          3 (Routers)
                         15 (Domainname)
                          6 (DNS server)
                        119 (Domain Search)
                         12 (Host name)
                         44 (NetBIOS name server)
                         47 (NetBIOS scope)
                         26 (Interface MTU)
                        121 (Classless Static Route)
                         42 (NTP servers)

---------------------------------------------------------------------------

  TIME: 2015-05-14 16:53:20.961
    IP: 192.168.1.100 (e8:11:32:3d:a2:1) > 192.168.1.2 (b8:27:eb:f9:54:da)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 897ed007
  SECS: 46
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 192.168.1.2
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: b8:27:eb:f9:54:da:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         192.168.1.100
OPTION:  51 (  4) IP address leasetime      600 (10m)
OPTION:   1 (  4) Subnet mask               255.255.255.0
OPTION:  28 (  4) Broadcast address         192.168.1.255
OPTION:   3 (  4) Routers                   192.168.1.1
OPTION:  15 ( 11) Domainname                example.org
--------------------------------------------------------------------------

and so on. /etc/dhcp/dhcpd.conf on the server has:

# Set up our desired subnet:
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.0 192.168.1.254;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
    authoritative;
}

What's going on? I checked the Raspberry Pi SD card, but there's no /var/log/syslog, so I don't know if dhclient is receiving the offer. Just to make it more frustrating, it worked once, the first time I tried it. I was able to ssh to the Pi, but the connection froze, and since then it's been stuck in this state. I've tried tweaking the configuration, but to no avail.

  • I accidentally firewalled off my DHCP replies once. After I fixed my firewall, the problem went away. It's a long shot, Rpi doesn't ship with a firewall by default. I did this to myself... but on the off chance that it helps :-) – izak Mar 20 '16 at 21:46
  • Just an observation not an answer. To me, it looks like you have a very short lease time. Is the time kept for each MAC? That would explain it working once. – PaulF8080 May 5 '16 at 4:47
  • Your dhcp address range looks wtong to me, can you change it to range 192.168.1.10 192.168.1.254; and try again? – ott-- Jul 4 '16 at 10:04
1

I ran into this once with a pfSense box. The issue wound up being that both the pfSense and the Pi had auto-MDI-X and somehow that failed. The pfSense side was working, so I could see pfSense respond with a DHCPoffer, but the Pi would not see it.

I put in a switch and the Pi was happy. If you have the same situation, you could presumably use a crossover cable, but you still might get tripped up by auto-MDIX.

You can read about that here.

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.