This is a patch to the /sbin/ifup file. It is from Red Hat 6.0 (Hedwig). It has not been tested with any other versions of Red Hat.
/sbin/ifup file, from the initscripts-4.16-1 package of Red Hat 6.0 (this should already be included on your system if you did a proper install)
Our modified dhcpcd program, installed as /sbin/dhcpcd
Installation is simple. Simply uncompress the patchfile splashifup.patch, change to directory /sbin, and apply the patchfile to ifup:
patch < splashifup.patch
The next time you reboot, or restart your interfaces, the changed script will take effect. Please read the section below, so you will know what changes have been made, to avoid any surprises!
I am assuming that you are familiar with the Red Hat boot sequence with respect to network cards, and that you know about the various Red Hat network configuration files. I am also assuming that you know the basics of how DHCP works.
You will also need to arrange things as follows (read below for explanation):
Three new parameters accepted in the /etc/sysconfig/network-scripts/ifcfg-* files:
DHCPLEASETIME the requested DHCP lease time that is sent to the server, in seconds. Note that the server may in fact issue a different lease time, as this is only a request. A value of 0 (zero) is infinite.
DHCPTIMEOUT the time to wait for a response from the DHCP server, in seconds. Note that the script will retry the dhcpcd program periodically, and that this timeout refers to the total time taken by all retries. This cannot be zero.
DHCPCLASSID the freeform string that is sent to the DHCP server, to help identify the client. This can be any value, including blank. This is placed directly on the command line, so any special characters must be quoted from the shell!
If omitted, default values will be used, as listed in the script.
Multiple attempts are now made to contact the DHCP server. This is controlled by the RETRIES parameter within the script (currently hardcoded at 8). Note that changing this value will change the amount of time between each retry, but the overall amount of time (set by DHCPTIMEOUT) will not change.
Handling of the BOOTPROTO parameter has been fixed, treating "bootp" as a synonym for dhcp, and "static" as a synonym for none.
The user's preset configuration (in the ifcfg-* files) is preserved, even if DHCP is in use. It will be used as a fallback; if the DHCP server fails to provide all needed fields of information, the missing fields will automatically be filled in by using the information from the preset configuration.
Uses the dhcpcd program, instead of pump. Red Hat's pump program, the default, is unusable for our purposes. The output of dhcpcd is stored in the /etc/dhcpc/ directory, and parsed by the script.
Does not change the /etc/resolv.conf file. If you want DHCP to pick up the DNS server, it can easily be added.
Includes the system's preconfigured hostname (without domain name), if any, in the request to the DHCP server. This allows the DHCP server to recognize the system by name (allowing its previous IP address to be reassigned). However, if the DHCP server assigns a new hostname and/or domain name, that will take precedence.
Automatically updates /etc/hosts to contain the system's new hostname and domain name. The file /etc/hosts.template is copied and appended to.
Automatically generates a unique hostname for the system, if none is available (either from the preconfigured information or from the DHCP server). The hostname is guaranteed to be unique, by using the MAC address of the interface's hardware.
Miscellaneous bugs are fixed, including a bug in which multiple gateways would accidentally be added (thus confusing routing). The script ensures that only the device specified as GATEWAYDEV (in /etc/sysconfig/network) will be used as the gateway, even if the DHCP server says otherwise.
Return to Splash Open Source Page