DHCP Client Info

Rick Stevens rstevens at vitalstream.com
Fri Jun 4 20:08:50 UTC 2004


Chris wrote:
> I have used Redhat 7.2 on my firewall/gateway machine for quite a while.
> My ISP assigns a dynamic IP address and the dhcpcd daemon creates a file
> called /etc/dhcpc/dhcpcd-eth0.info. I source that file to get the
> variables that I use in my firewall script. It is in the form of
> IPADDR=X.X.X.X. . it has allot of useful variables already created. I
> think pump did something similar. Anyway, it seems that later versions
> of Redhat and Fedora use dhclient. I can not seem to find a similar file
> created with dhclient. I don't want to write a separate script to get
> the data from ifconfig or the leases file that is created unless I have
> to. Is there a way to get dhclient to behave like dhcpcd and create a
> similar file or am I just missing it?

Nope.  dhclient is totally different.  You'll have to parse the files
you mentioned.  You really should use ifconfig, /etc/resolv.conf,
netstat and the rest anyway as those will always work--even if you use a
fixed IP at some future date.  They're what the system is really doing,
not what the last DHCP client may have logged.  Relying on a log file
is not necessarily a good thing.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-              Careful!  Ugly strikes 9 out of 10 people!            -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list