Automatically renew DHCP address on RHEL4
I need it to report it's hostname to the DHCP server to create a DNS entry for it. I've tried a few things but no luck so far.
dhclient gives command not found dhcpcd also command not found as does netconf /etc/sysconfig/network is a file there is no dhco file in /etc/sysconfig/ from http://www.novell.com/coolsolutions/trench/16013.html ifcfg-eth0 (under /etc/sysconfig/network-scripts) already has BOOTPROTO="dhcp" |
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.
Code:
BOOTPROTO=dhcp 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 Quote:
Quote:
|
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.
Thanks again, Mark |
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.
|
All times are GMT -5. The time now is 01:55 PM. |