disabling dhclient

Perry Hutchison perryh at pluto.rain.com
Mon Aug 31 05:13:17 UTC 2015


"Thomas Mueller" <mueller6724 at bellsouth.net> wrote:

> I don't have ifconfig in /etc/rc.conf, dhclient never runs
> automatically on my system.  This is true for both FreeBSD
> and NetBSD.

That used to be true for this system also (or, if it ran, it
didn't do anything).  I don't know what changed.

> There is a line in /etc/defaults/rc.conf 
>
> dhclient_program="/sbin/dhclient"       # Path to dhcp client program.
>
> Setting dhclient_program="/usr/bin/true" in /etc/rc.conf would
> avoid the need to hack dhclient itself

That still seems in the sledgehammer category, since I doubt it's
the intended use of the knob (which is more likely intended to select
a different DHCP client, perhaps from a port).  However, it's worth
a try.

I suspect /bin/sync may be a better choice than /usr/bin/true,
since devd can potentially fire up before /usr has been mounted;
alternatively one could copy /usr/bin/true into /bin or /sbin (but
then we are back to hacking on the system rather than configuring
it).

> I don't know if this would prevent dhclient from working from the
> command line.

If I'm understanding the /etc/dhclient script correctly, it would
effectively disable that script -- which is perfectly OK for this
particular situation.  I would not expect any effect on running
/sbin/dhclient directly.


More information about the freebsd-questions mailing list