dhcpd-client floods /var/log/messages. Can I stop this?

Bill Moran wmoran at potentialtech.com
Tue Apr 27 07:27:46 PDT 2004


Rob wrote:
> Hi,
> 
> I have a PC that gets its internet via dhcp-client.
> Eventually this will connect to my ISP, but for now it
> is served by a dhcpd-server on another FreeBSD PC of mine.

Your question got me curious, so I did a little hunting ...

Unfortunately, I couldn't find any config options for dhclient to
reduce (or stop) the logging.

However, I do have an improvement that can be implemented on the dhcp
server.  If you see below, you default lease time is 10 minutes (600
seconds)  In the logs, your lease is being renewed every 5 minutes (per
the dhcp spec, the client should start trying to renew the lease
halfway before it expires).

So, one way to reduce the amount of data that is logged is to increase
the default lease time.  If you have more addresses than you have
machines (which is probably likely with the IP range you're using) you
can safely set the lease time to several days (maybe even weeks ... I
don't remember what the max value is).  If you set the default lease
time to two days (for example) you will only get a renewal log message
once a day.

HTH.

> On the server, /usr/local/etc/dhcpd.conf is configured
> as:
>   authoritative;
>   ddns-update-style ad-hoc;
>   subnet 10.0.0.0 netmask 255.255.255.0 {
>     range 10.0.0.2 10.0.0.254;
>     option routers 10.0.0.1;
>     option broadcast-address 10.0.0.255;
>     option subnet-mask 255.255.255.0;
>     option domain-name "thuis.domein";
>     option domain-name-servers ercc.snu.ac.kr, erccw1.snu.ac.kr;
> 
>     default-lease-time 600;
>     max-lease-time 7200;
>   }
> 
> When I go to the client PC (10.0.0.254) and check its
> /var/log/messages file, it is flooded with lines like this:
> 
> [...]
> Apr 27 10:28:21 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:28:21 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:33:14 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:33:14 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:37:57 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:37:57 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:42:28 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:42:28 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:46:24 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:46:24 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:51:11 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:51:11 router dhclient: New Broadcast Address: 10.0.0.255
> Apr 27 10:54:58 router dhclient: New Network Number: 10.0.0.0
> Apr 27 10:54:58 router dhclient: New Broadcast Address: 10.0.0.255
> 
> 
> I don't need all these lines in my messages file; it actually obscures
> other relevant information in here. What can I do to dhclient to
> not do this?


-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com


More information about the freebsd-questions mailing list