no DHCPRELEASE sent out by dhclient -r on Linux

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

no DHCPRELEASE sent out by dhclient -r on Linux

Marc Haber
Hi,

I am seeing this behavior with dhclient 4.3.1 on grml, but I suspect
that other versions of dhclient do the same.

When I tell dhclient to explicitly release the current lease (dhclient
-r), I see the following behavior:

root@grml ~ # dhclient -v -r eth0
Killed old client process
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/52:54:00:4d:cc:3d
Sending on   LPF/eth0/52:54:00:4d:cc:3d
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.181.13 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
dhclient.c:2331: Failed to send 300 byte long packet over fallback interface.
root@grml ~ #

The README only documents some weirdness with Linux kernels older than
2.2, so I guess that it doesn't apply to my Linux 3.16.

But why does dhclient obviously take down the interface before it
tries to send out the DHCPRELEASE packet? What is that "failed to send
paket over fallback interface" message? I think that the vast majority
of systems running dhclient won't have a second interface.

How do I actually send out a DHCPRELEASE?

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: no DHCPRELEASE sent out by dhclient -r on Linux

Peter Rathlev
Hi Marc,

On Wed, 2015-07-08 at 14:03 +0200, Marc Haber wrote:
> When I tell dhclient to explicitly release the current lease (dhclient
> -r), I see the following behavior:
>
> root@grml ~ # dhclient -v -r eth0
> Killed old client process
<snip>

You need to point out to dhclient where the lease file is with the "-lf"
parameter. It should then release exactly that lease. Since the lease
file could be placed anywhere this is necessary.

You can probably see where the lease file is by looking at the running
dhclient process which should also have the "-lf" parameter:

$ ps ax | fgrep dhclient
19902 ? S 0:00 /sbin/dhclient -d -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-em1.pid -lf /var/lib/NetworkManager/dhclient-f8232193-9bbb-42fc-93d9-1cc08a5f0964-em1.lease -cf /var/lib/NetworkManager/dhclient-em1.conf em1

Sorry for the long line. :-)

--
Peter




_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: no DHCPRELEASE sent out by dhclient -r on Linux

Marc Haber
Hi Peter,

On Fri, Jul 10, 2015 at 09:35:05AM +0200, Peter Rathlev wrote:

> On Wed, 2015-07-08 at 14:03 +0200, Marc Haber wrote:
> > When I tell dhclient to explicitly release the current lease (dhclient
> > -r), I see the following behavior:
> >
> > root@grml ~ # dhclient -v -r eth0
> > Killed old client process
> <snip>
>
> You need to point out to dhclient where the lease file is with the "-lf"
> parameter. It should then release exactly that lease. Since the lease
> file could be placed anywhere this is necessary.

It doesn't, the behavior doesn't change:
root@grml ~ # dhclient -v -lf leasefile eth0
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/52:54:00:a2:6f:ef
Sending on   LPF/eth0/52:54:00:a2:6f:ef
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.182.254
DHCPACK from 192.168.182.254
Setting hostname to grml: done
bound to 192.168.182.154 -- renewal in 146 seconds.
root@grml ~ # dhclient -v -r -lf leasefile eth0
Killed old client process
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/52:54:00:a2:6f:ef
Sending on   LPF/eth0/52:54:00:a2:6f:ef
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.181.13 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
dhclient.c:2331: Failed to send 300 byte long packet over fallback interface.
root@grml ~ # cat leasefile
lease {
  interface "eth0";
  fixed-address 192.168.182.154;
  option subnet-mask 255.255.255.0;
  option dhcp-lease-time 290;
  option dhcp-message-type 5;
  option dhcp-server-identifier 192.168.181.13;
  option domain-name-servers 192.168.181.12,192.168.181.12;
  option domain-search "ka51.zugschlus.de.", "zugschlus.de.";
  option domain-name "ka51.zugschlus.de";
  renew 5 2015/07/10 17:38:19;
  rebind 5 2015/07/10 17:40:06;
  expire 5 2015/07/10 17:40:43;
}
lease {
  interface "eth0";
  fixed-address 192.168.182.154;
  option subnet-mask 255.255.255.0;
  option dhcp-lease-time 290;
  option dhcp-message-type 5;
  option dhcp-server-identifier 192.168.181.13;
  option domain-name-servers 192.168.181.12,192.168.181.12;
  option domain-search "ka51.zugschlus.de.", "zugschlus.de.";
  option domain-name "ka51.zugschlus.de";
  renew 5 2015/07/10 17:35:58;
  rebind 5 2015/07/10 17:35:58;
  expire 5 2015/07/10 17:35:58;
}

Even when not pointing the dhcp client to the leasefile, it tries to
send a DHCPELEASE, but it takes down the interface first.

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users