Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you just want it to send its hostname when requesting dhcp assigned IP you should be able to do this with the DHCP_HOSTNAME variable in the ifcfg-eth* file.
This should then create a file /etc/dhclient-eth*.conf with something like: send host-name "myhost.domain.local"; that dhclient will use when requesting an IP.
after adding the line you specify and rebooting I did
Code:
ls /etc | grep dhclient
dhclient-eth0.conf
resolv.conf.predhclient
the first file contains the following
Quote:
send host name "<machine-name>.domain.local"; #temporary RHL ifup addition
The second contains
Quote:
; generated by /sbin/dhclient-script
nameserver <ip-address>
nameserver <ip-address>
dhclient is clearly installed but I still get a command not found when trying to launch it from command line (as root)? Also it says it's temporary, I need it to do it every time. Is there some way of making it permanent? thanks for the information so far .
I'm fairly sure it is /sbin/dhclient. When you are "as root" are you a)logging in as root, b) su to root, or c) su -(or su - root)? It sounds like your $PATH may not be properly set...
As far as having it permanent that is what adding the line in the network-scripts/ifcfg-ethX file does for you. The line in the dhclient-ethX.conf _is_ temporary in-so-much as it added by an external script (ifup) and can be removed by it (ifdown) when shutting down the interface. However, as long as the variable persists in the ifcfg-ethX file it will always be added to the dhclient-ethX.conf when ifup is run on the interface.
Thanks for clarifying that rayfordj, it's been a big help. And to answer your question, I su to root as needed. I'll also take a look at that $PATH variable you mention.
if you just use 'su' then you keep your user's $PATH rather than sourcing root's $PATH. 'su -' (or 'su - root') will, among other things, source root's $PATH so that you get all of the sbin directories.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.