dhclient – Extend lease time.

If you are using network manager, it seems to set a short least time of about 7200 seconds. If you are running a server that is on a cloud, you might need DHCP but only once a year or for kernel upgrades. The /var/log/messages will fill with a bunch of these lines.

Oct 29 23:01:20 server dhclient[14639]: DHCPREQUEST on eth0 to port 67 (xid=0x4bf05d29)

Oct 29 23:01:20 server dhclient[14639]: send_packet: Operation not permitted

Oct 29 23:01:20 server kernel: Firewall: *UDP_OUT Blocked* IN= OUT=eth0 SRC= DST= LEN=331 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=68 DPT=67 LEN=311 UID=0 GID=0

You can extend the length of renewal by adding the line below to the dhclient.conf  file(may be dhclient-eth0.conf).

send dhcp-lease-time 86400;

You can also just type this without using vi. Your own dhclient might be in a diff directory so check to be sure of its location.

echo “send dhcp-lease-time 86400;” >> /etc/dhcp/dhclient-eth0.conf

Set it to whatever amount of seconds that you prefer and then restart the network.

service network restart

Thats it. Your new log output should show something like this.

Oct 29 23:01:33 server dhclient[7906]: bound to — renewal in 37534 seconds.

Hope this helps!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.