dhclient 4.3.1 aquires / releases leases on all interfaces called for one

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

dhclient 4.3.1 aquires / releases leases on all interfaces called for one

Ingo Wolf
Hi,

my dhclient 4.3.1 on latest raspbian aquires leases on all interfaces
called for wlan0

dhclient -v -pf /run/dhclient.wlan0.pid -lf
/var/lib/dhcp/dhclient.wlan0.leases wlan0

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/00:e0:4c:53:44:58
Sending on   LPF/eth0/00:e0:4c:53:44:58
Listening on LPF/wlan0/b8:27:eb:27:cc:e1
Sending on   LPF/wlan0/b8:27:eb:27:cc:e1
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.3.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.3.1
DHCPACK from 192.168.3.1
RTNETLINK answers: File exists
Restarting ntp (via systemctl): ntp.service.
bound to 192.168.3.46 -- renewal in 34503 seconds.

The Problem is both leases eth0/wlan0 are written to lease file and on
ifdown wlan0 eth0 lease is also canceled,
so eth0 is also not working after, bound to ip also is the eth0 one
wlan0 is .39 .

I wrote a wrapper script for dhclient removing leases for other
interfaces from lease file to get it working for now:

cat /usr/local/sbin/dhclient

#!/bin/bash
echo dhclient $@ 2>&1 | tee -a /home/pi/dhc.log
echo $2 $6 $7 | tee -a /home/pi/dhc.log

if [ "$2" =  "-r" ]; then

     sed -r 's/^lease
[{]$/\0/;tp;d;:p;N;s/interface/\0/;Tp;s/'"$7"'/\0/;tm;d;:m;N;s/[}]/\0/;Tm'
"$6" > "$6"

     cat "$6" >> /home/pi/dhc.log
fi
/sbin/dhclient "$@" 2>&1 | tee -a /home/pi/dhc.log

Ingo

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Loading...