DHCP or Dynamic Host Control Protocol is the direct cousin of BOOTP.
- Host name and FQDN - IP address, mask and default gateway - DNS servers - WINS servers (optional) - etc. The Internet peoples at be realized the BOOTP was fairly inflexible and wouldn't grow with new features. So DHCP is a flexible protocol that, much like PPP, has negotiated parameters, that can send out everything from IP addresses to NTP servers. DHCP is a great system to be able to just plug a DHCP-compatible computer and DHCP will configure its whole network system on the FLY. DHCP is very flexible. You can give it pools of dynamic IPs to give out, statically give certain machines STATIC IPs (like below), etc.Please see the DHCP RFCs in Section 5 for more details.
Though TrinityOS primarily supports Redhat, I'm contantly adding support for other Linux distributions. If you have additions or comments, please let me know.
- Make sure that the /etc/rc.d/rc3.d/S65dhcpd exists If not, enable it as defined in Section 8
- Edit the file /etc/rc.d/init.d/dhcpd and change the following.
NOTE: This configuration assumes you want to serve DHCP leases ONLY on the "eth1" interface
Start section line from:
-- daemon dhcpd -- to -- route add -host 255.255.255.255 eth1 daemon dhcpd eth1 --
NOTE: You need to change the "interface" name to whatever INTERNAL LAN interface you want DHCP to run on. i.e. You DON'T want DHCP to run on your Internet connection!!
Add the following line to the /etc/rc.d/rc.inet1 file:
route add -host 255.255.255.255 eth1
Add a line to execute dhcpd in the /etc/rc.d/rc.local file like:
/usr/sbin/dhcpd eth1
TurboLinux uses ISC's /sbin/dhclient instead of the traditionaly used Linux clients.
The configuration file for dhclient is found in /etc/dhclient.conf and control shell script of /etc/dhclient-script. This script has provisions to source a user-defined /etc/dhclient-exit-hooks file which it executes if found. Putting it simply, you can simply add the line "/etc/rc.d/init.d/firewall restart" to the /etc/dhclient-script file to properly load the firewall upon various DHCP events.
NOTE: This config defines a STATIC IP address per core machine. All other machines get dynamic DHCP IP addresses. I do this for security reasons.
To find out the MAC address of a machine's Ethernet card, do the following:
Win95: run "winipcfg" WinNT: run "ipconfig /all" Linux: run "arp"
- For ALL distributions using the DHCPcd client, create and modify the file /etc/dhcpd.conf
--<begin>-- server-identifier roadrunner-int.acme123.com; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.1; option domain-name-servers 192.168.0.1, 24.1.64.33, 24.1.64.34; option domain-name "acme123.com"; default-lease-time 86400; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.9 192.168.0.10; } host coyote.acme123.com { hardware ethernet 00:60:08:B1:36:4A; fixed-address 192.168.0.4; } --<end>--
Next, you need to create the dhcp.leases file:
"touch /etc/dhcpd.leases"
As mentioned above, you will need to replace the hardware Ethernet MAC addresses with the MAC addresses of your specific NIC cards.
* Ok, now you need to put in all of your DHCP IP addresses into DNS as described in Section 24 and then restart Bind.
Now, you need to make sure you have the following lines in your /etc/services file:
-- bootps 67/udp # bootp server bootpc 68/udp # bootp client --
Finally, lets start DHCP up:
Slackware: Run "/usr/sbin/dhcpd eth1"
Redhat: Run "/etc/rc.d/init.d/dhcpd start"
* Additional security: DHCPd runs as root in a non-chroot'ed way. If you are paranoid about security, check out the LASG doc. The URL is in Section 5
If that works well, you should enable DHCP full time:
Redhat:
chkconfig --level 2345 dhcpd on