Discussion:
dhclient and backgrounding
(too old to reply)
Zafer Aydogan
2006-11-15 15:07:56 UTC
Permalink
hello list,

does dhclient do no backgrounding ?
I mean, if I turn on my computer (dhclient=yes) and forget to turn on
my switch, which is connected to my router, who has a dhcp server, I
do not get a lease when I turn it back on afterwards.

I thought, that dhclient would sit and wait until it notices the dhcp
server is back up and then requests a lease so that I can get an IP
Adresss, but nothing happens.

The dhclient process is still alive and the only way I know to
workaround this is to pkill dhclient and restart dhclient.

Am I missing something ?

On the contrary, this works on XP flawlessly.

Zafer.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2006-11-15 15:32:27 UTC
Permalink
Post by Zafer Aydogan
hello list,
does dhclient do no backgrounding ?
I mean, if I turn on my computer (dhclient=yes) and forget to turn on
my switch, which is connected to my router, who has a dhcp server, I
do not get a lease when I turn it back on afterwards.
I thought, that dhclient would sit and wait until it notices the dhcp
server is back up and then requests a lease so that I can get an IP
Adresss, but nothing happens.
The dhclient process is still alive and the only way I know to
workaround this is to pkill dhclient and restart dhclient.
Am I missing something ?
From what I remember dhclient finally gets an IP, but you have to wait several
minutes (10 to 15 maybe). But this was several releases ago ...
--
Manuel Bouyer, LIP6, Universite Paris VI. ***@lip6.fr
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Hubert Feyrer
2006-11-15 15:43:21 UTC
Permalink
Post by Manuel Bouyer
Post by Zafer Aydogan
Am I missing something ?
From what I remember dhclient finally gets an IP, but you have to wait several
minutes (10 to 15 maybe). But this was several releases ago ...
from dhclient(8): ``Old leases are kept around in case the DHCP server is
unavailable when dhclient is first invoked (generally during the initial
system boot process). In that event, old leases from the dhclient.leases
file which have not yet expired are tested, and if they are determined to
be valid, they are used until either they expire or the DHCP server
becomes available.''

And from dhclient.conf(5):

The retry statement

retry time;

The retry statement determines the time that must pass after the client
has determined that there is no DHCP server present before it tries
again to contact a DHCP server. By default, this is five minutes.

Maybe this helps...


- Hubert

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Steven M. Bellovin
2006-11-15 15:51:51 UTC
Permalink
Post by Manuel Bouyer
Post by Zafer Aydogan
hello list,
does dhclient do no backgrounding ?
I mean, if I turn on my computer (dhclient=yes) and forget to turn on
my switch, which is connected to my router, who has a dhcp server, I
do not get a lease when I turn it back on afterwards.
I thought, that dhclient would sit and wait until it notices the dhcp
server is back up and then requests a lease so that I can get an IP
Adresss, but nothing happens.
The dhclient process is still alive and the only way I know to
workaround this is to pkill dhclient and restart dhclient.
Am I missing something ?
From what I remember dhclient finally gets an IP, but you have to wait several
minutes (10 to 15 maybe). But this was several releases ago ...
See the dhclient.conf man page -- you can change 'retry' (and some other
timer-related options) to change that behavior.

--Steven M. Bellovin, http://www.cs.columbia.edu/~smb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Zafer Aydogan
2006-11-15 16:32:42 UTC
Permalink
Post by Steven M. Bellovin
Post by Manuel Bouyer
Post by Zafer Aydogan
hello list,
does dhclient do no backgrounding ?
I mean, if I turn on my computer (dhclient=yes) and forget to turn on
my switch, which is connected to my router, who has a dhcp server, I
do not get a lease when I turn it back on afterwards.
I thought, that dhclient would sit and wait until it notices the dhcp
server is back up and then requests a lease so that I can get an IP
Adresss, but nothing happens.
The dhclient process is still alive and the only way I know to
workaround this is to pkill dhclient and restart dhclient.
Am I missing something ?
From what I remember dhclient finally gets an IP, but you have to wait several
minutes (10 to 15 maybe). But this was several releases ago ...
See the dhclient.conf man page -- you can change 'retry' (and some other
timer-related options) to change that behavior.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
I did. It looks promising. But it didn't work.
I run tcpdump and kept an eye on it.
The man page says the default retry time is 5 minutes.
I waited 18 Minutes and nothing happened. The interface is up and
active but has still no IP.


and Hubert's quote doesn't work either.
"from dhclient(8): ``Old leases are kept around in case the DHCP server is
unavailable when dhclient is first invoked (generally during the initial
system boot process). In that event, old leases from the dhclient.leases
file which have not yet expired are tested, and if they are determined to
be valid, they are used until either they expire or the DHCP server
becomes available.''

I see the message "using old lease 192.168.0.203", but the interface
doesn't get configured.


Anything else I can do ?
I'm running current from 8th Nov. and my ethernet interface is fxp0.
(It's running very well.)
Is this maybe a dhclient bug ?
Zafer.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Zafer Aydogan
2006-11-15 21:27:19 UTC
Permalink
Hello Steven,

it would be great if the dhclient.conf manpage would contain the
default location for itself (for the file dhclient.conf). I guess it's
/etc/dhclient.conf but it isn't mentioned anywhere.
And the unit of time in the retry statement "retry [time]" would be
great. It says the default is 5 minutes, but the example at the bottom
says "retry 60;", so I guess it's seconds.

Least but not last. It doesn't matter what I enter for retry, it is ignored.

Cheers, Zafer.
Post by Zafer Aydogan
Post by Steven M. Bellovin
See the dhclient.conf man page -- you can change 'retry' (and some other
timer-related options) to change that behavior.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
I did. It looks promising. But it didn't work.
I run tcpdump and kept an eye on it.
The man page says the default retry time is 5 minutes.
I waited 18 Minutes and nothing happened. The interface is up and
active but has still no IP.
and Hubert's quote doesn't work either.
"from dhclient(8): ``Old leases are kept around in case the DHCP server is
unavailable when dhclient is first invoked (generally during the initial
system boot process). In that event, old leases from the dhclient.leases
file which have not yet expired are tested, and if they are determined to
be valid, they are used until either they expire or the DHCP server
becomes available.''
I see the message "using old lease 192.168.0.203", but the interface
doesn't get configured.
Anything else I can do ?
I'm running current from 8th Nov. and my ethernet interface is fxp0.
(It's running very well.)
Is this maybe a dhclient bug ?
Zafer.
I'll reply in more detail later -- I have a feeling something more complex
is going on.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Zafer Aydogan
2006-11-25 10:46:39 UTC
Permalink
I just wanted to pick up this subject again, because it doesn't seem
to work. (at least for me.)
retry and reboot options in etc/dhclient.conf seems to be ignored.

Meanwhile I found out that FreeBSD switched from ISC dhclient to
OpenBSD's dhclient implementation since 6.0. Anybody know why ?

Anyway, I just wanted to express that the current state of dhclient is
unsatisfying.
There seems to be no way to obtain an IP Adress, after you missed the
initial dhclient discover process. :/
Grrr.....
Post by Zafer Aydogan
Hello Steven,
it would be great if the dhclient.conf manpage would contain the
default location for itself (for the file dhclient.conf). I guess it's
/etc/dhclient.conf but it isn't mentioned anywhere.
And the unit of time in the retry statement "retry [time]" would be
great. It says the default is 5 minutes, but the example at the bottom
says "retry 60;", so I guess it's seconds.
Least but not last. It doesn't matter what I enter for retry, it is ignored.
Cheers, Zafer.
Post by Zafer Aydogan
Post by Steven M. Bellovin
See the dhclient.conf man page -- you can change 'retry' (and some other
timer-related options) to change that behavior.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
I did. It looks promising. But it didn't work.
I run tcpdump and kept an eye on it.
The man page says the default retry time is 5 minutes.
I waited 18 Minutes and nothing happened. The interface is up and
active but has still no IP.
and Hubert's quote doesn't work either.
"from dhclient(8): ``Old leases are kept around in case the DHCP server is
unavailable when dhclient is first invoked (generally during the initial
system boot process). In that event, old leases from the dhclient.leases
file which have not yet expired are tested, and if they are determined to
be valid, they are used until either they expire or the DHCP server
becomes available.''
I see the message "using old lease 192.168.0.203", but the interface
doesn't get configured.
Anything else I can do ?
I'm running current from 8th Nov. and my ethernet interface is fxp0.
(It's running very well.)
Is this maybe a dhclient bug ?
Zafer.
I'll reply in more detail later -- I have a feeling something more complex
is going on.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alexandre Almeida
2006-11-27 12:48:34 UTC
Permalink
Post by Zafer Aydogan
I just wanted to pick up this subject again, because it doesn't seem
to work. (at least for me.)
retry and reboot options in etc/dhclient.conf seems to be ignored.
Meanwhile I found out that FreeBSD switched from ISC dhclient to
OpenBSD's dhclient implementation since 6.0. Anybody know why ?
Anyway, I just wanted to express that the current state of dhclient is
unsatisfying.
There seems to be no way to obtain an IP Adress, after you missed the
initial dhclient discover process. :/
Grrr.....
Post by Zafer Aydogan
Hello Steven,
it would be great if the dhclient.conf manpage would contain the
default location for itself (for the file dhclient.conf). I guess it's
/etc/dhclient.conf but it isn't mentioned anywhere.
And the unit of time in the retry statement "retry [time]" would be
great. It says the default is 5 minutes, but the example at the bottom
says "retry 60;", so I guess it's seconds.
Least but not last. It doesn't matter what I enter for retry, it is ignored.
Cheers, Zafer.
Post by Zafer Aydogan
Post by Steven M. Bellovin
See the dhclient.conf man page -- you can change 'retry' (and
some other
Post by Zafer Aydogan
Post by Steven M. Bellovin
timer-related options) to change that behavior.
--Steven M. Bellovin,
http://www.cs.columbia.edu/~smb
Post by Zafer Aydogan
I did. It looks promising. But it didn't work.
I run tcpdump and kept an eye on it.
The man page says the default retry time is 5 minutes.
I waited 18 Minutes and nothing happened. The interface is up and
active but has still no IP.
and Hubert's quote doesn't work either.
"from dhclient(8): ``Old leases are kept around in case the DHCP
server is
Post by Zafer Aydogan
unavailable when dhclient is first invoked (generally during the
initial
Post by Zafer Aydogan
system boot process). In that event, old leases from the
dhclient.leases
Post by Zafer Aydogan
file which have not yet expired are tested, and if they are
determined to
Post by Zafer Aydogan
be valid, they are used until either they expire or the DHCP server
becomes available.''
I see the message "using old lease 192.168.0.203", but the interface
doesn't get configured.
Anything else I can do ?
I'm running current from 8th Nov. and my ethernet interface is fxp0.
(It's running very well.)
Is this maybe a dhclient bug ?
Zafer.
I'll reply in more detail later -- I have a feeling something more
complex
is going on.
--Steven M. Bellovin, http://www.cs.columbia.edu/~smb
Hello ...
I'm using dhclient, and my experience is being quite satisfactory (with
some "bugs"...).

I'm using this configuration:
/etc/dhclient.conf
timeout 60;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
#reject 192.33.137.209;

interface "tlp1" {
send host-name "maneofhost";
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 360;
#supersede domain-name "fugue.com rc.vix.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#request subnet-mask, broadcast-address, time-offset, routers,
domain-name, doma
in-name-servers, host-name;
#require subnet-mask, domain-name-servers;
#script "CLIENTBINDIR/dhclient-script";
#media "media 10baseT/UTP", "media 10base2/BNC";
}

#alias {
#interface "tlp1";
#fixed-address 192.168.1.101;
#option subnet-mask 255.255.255.0;
#}


/etc/ifconfig.ex0
up
!dhclient $int
inet 192.168.1.101 netmask 255.255.255.0 alias
!route add default 192.168.1.254

some results on tcpdump

# tcpdump -n port 67
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tlp0, link-type EN10MB (Ethernet), capture size 96 bytes
13:11:30.008996 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
from 00:00:f8:09:85:be, length: 300
13:11:45.010281 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
from 00:00:f8:09:85:be, length: 300
13:11:55.006929 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
from 00:00:f8:09:85:be, length: 300
13:13:09.039705 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
from 00:00:f8:09:85:be, length: 300
13:13:11.001987 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request
from 00:00:f8:09:85:be, length: 300

and process

# ps -x
PID TTY STAT TIME COMMAND
0 ? DKs 0:00.22 [swapper]
1 ? Is 0:00.06 init
2 ? DK 0:00.00 [cryptoret]
3 ? DK 0:00.00 [scsibus0]
4 ? DK 0:00.00 [pms0]
5 ? DK 0:00.00 [pagedaemon]
6 ? DK 7:34.61 [ioflush]
7 ? DK 0:00.30 [aiodoned]
149 ? Ss 0:05.76 /usr/sbin/syslogd -s
269 ? Is 0:21.26 /usr/sbin/sshd
361 ? Ss 0:15.85 sendmail: accepting connections
378 ? Is 0:00.01 /usr/sbin/inetd -l
381 ? Is 0:01.97 /usr/sbin/cron
404 ? Is 0:00.19 sshd: rty [priv]
426 ? Is 0:00.19 sshd: rty [priv]
2970 ? Ss 0:06.30 dhclient
2981 ? Is 0:00.20 sshd: rty [priv]
6609 ? Is 0:00.21 sshd: rty [priv]
40 ttyp1 S 0:00.67 ksh
28296 ttyp1 R+ 0:00.00 ps -x
9714 ttyp2 I+ 0:00.09 ksh
7068 ttyp3 I+ 0:00.09 ksh
403 ttyE0 Is 0:00.06 login
406 ttyE0 I+ 0:00.03 -ksh


Alexandre Almeida

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...