7

I connected my rPi to my iPhone via Bluetooth and configured bluetooth interface in the following way in /etc/network interfaces:

# iPhone via Bluetooth
allow-hotplug bnep0
iface bnep0 inet dhcp

It gets an IP address from the phone and the internet connection works but for some reason dhclient keeps sending DHCP discovery requests to that interface even after the address was obtained. This extract is from /var/log/syslog:

Oct 18 08:00:36 raspberrypi dhclient: Internet Systems Consortium DHCP Client 4.2.2
Oct 18 08:00:36 raspberrypi dhclient: Copyright 2004-2011 Internet Systems Consortium.
Oct 18 08:00:36 raspberrypi dhclient: All rights reserved.
Oct 18 08:00:36 raspberrypi dhclient: For info, please visit https://www.isc.org/software/dhcp/
Oct 18 08:00:36 raspberrypi dhclient: 
Oct 18 08:00:36 raspberrypi dhclient: Listening on LPF/bnep0/00:1b:10:00:2a:ec
Oct 18 08:00:36 raspberrypi dhclient: Sending on   LPF/bnep0/00:1b:10:00:2a:ec
Oct 18 08:00:36 raspberrypi dhclient: Sending on   Socket/fallback
Oct 18 08:00:36 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 8
Oct 18 08:00:36 raspberrypi dhclient: DHCPREQUEST on bnep0 to 255.255.255.255 port 67
Oct 18 08:00:36 raspberrypi dhclient: DHCPOFFER from 172.20.10.1
Oct 18 08:00:36 raspberrypi dhclient: DHCPACK from 172.20.10.1
Oct 18 08:00:36 raspberrypi dhclient: bound to 172.20.10.13 -- renewal in 40353 seconds.

…

Oct 18 08:05:45 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 5
Oct 18 08:05:50 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 7
Oct 18 08:05:57 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 10
Oct 18 08:06:07 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 10
Oct 18 08:06:17 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 14
Oct 18 08:06:31 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 15
Oct 18 08:06:46 raspberrypi dhclient: No DHCPOFFERS received.
Oct 18 08:06:46 raspberrypi dhclient: No working leases in persistent database - sleeping.
Oct 18 08:12:16 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 6
Oct 18 08:12:22 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 9
Oct 18 08:12:31 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 12
Oct 18 08:12:43 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 17
Oct 18 08:13:00 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 16
Oct 18 08:13:16 raspberrypi dhclient: DHCPDISCOVER on bnep0 to 255.255.255.255 port 67 interval 1
Oct 18 08:13:17 raspberrypi dhclient: No DHCPOFFERS received.
Oct 18 08:13:17 raspberrypi dhclient: No working leases in persistent database - sleeping.

And so on, ad infinitum. At this point the rPi already has the IP address and the internet connection works.

I also run dhcpdump and every minute or so there is an exchange of DHCP packets between the phone and rPi of this kind:

 TIME: 2013-10-16 22:24:14.540
    IP: 0.0.0.0 (0:1b:10:0:2a:ec) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: feee6720
  SECS: 37
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:1b:10:00:2a:ec: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        172.20.10.13
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: 2013-10-16 22:24:14.712
    IP: 172.20.10.1 (66:4c:c:bc:68:64) > 172.20.10.13 (0:1b:10:0:2a:ec)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: feee6720
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 172.20.10.13
SIADDR: 172.20.10.1
GIADDR: 0.0.0.0
CHADDR: 00:1b:10:00:2a:ec:00:00:00:00:00:00:00:00:00:00
 SNAME: Ollies-iPhone.
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         172.20.10.1
OPTION:  51 (  4) IP address leasetime      85536 (23h45m36s)
OPTION:   1 (  4) Subnet mask               255.255.255.240
OPTION:   3 (  4) Routers                   172.20.10.1
OPTION:   6 (  4) DNS server                172.20.10.1
---------------------------------------------------------------------------

  TIME: 2013-10-16 22:24:26.265
    IP: 0.0.0.0 (0:1b:10:0:2a:ec) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: feee6720
  SECS: 49
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 00:1b:10:00:2a:ec: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        172.20.10.13
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)

I don't think it should do this since the lease time is way longer than what those messages would imply. The question is – why does it do that and how to stop it?

6

I did a bit more research and it appears that the problem was in dhclient itself. There are numerous instances of it being mentioned if one googles "dhclient syslog DHCPDISCOVER". I was able to fix the problem by removing all *.leases files from /var/lib/dhcp, purging (not just removing, but purging) isc-dhcp-server (which was not running anyway but this removed its temporary and config files) and restarting. I do not know which of these helped but i would guess that deleting *.leases files did because the rPi configuration was for some reason duplicated in several of them.

3
  • Might be useful if you indicate how to purge isc-dhcp-server
    – puk
    Jul 17 '15 at 1:30
  • Sorry, I have no idea. I did it years ago and since then dumped isc-dhcp-server and switched to dnsmasq which IMO is much better designed for my particular use case. Jul 18 '15 at 20:20
  • sudo apt-get purge isc-dhcp-server ?
    – tomasb
    Oct 3 '17 at 10:56
1

it says quite clearly, you iDevice is unable to offer any IP address over DHCP:

Oct 16 22:13:13 raspberrypi dhclient: No DHCPOFFERS received.

as far as I see your RaspberryPi works just as intended, and you should direct your questions to the different areas where iDevices are discussed, especially where people talk about correct ways of running DHCP servers on them.

6
  • I had mentioned in my post that the iPhone issues the IP address just fine and as it can be seen from dhcpdump provided it also keeps responding to continuous stream of requests from rPi. My question was why does rPi keep asking for the address so often. Oct 17 '13 at 21:42
  • i don't see anything you describe in your logs, would be very helpful if you include that part too.
    – lenik
    Oct 17 '13 at 23:47
  • A combination of DHCPDISCOVER from raspberry pi and a consequent DHCPOFFER from the iPhone in the dhcpdump log? The fact that the setup works? I've already included the parts of the log which are relevant to my question. Oct 18 '13 at 6:58
  • I've added a fresh log showing how the address is being issued and confirmed. And the long sequence of additional DHCPDISCOVER requests that follows. Oct 18 '13 at 8:33
  • Nevermind, i solved it. Oct 18 '13 at 10:19
0

This might be a different scenario but I encountered a similar problem. I had two raspberry Pi's one is Pihole dhcp server and the other client. The issue was I set a static IP address on the client Pi via the GUI but in the config it was setting the config as:

inform=192.168.1.200

When I change it to:

static ipaddress=192.168.1.200

and restarted service, it stopped the discover log spam.

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.