Fairly straight forward

yum install dhcp
chkconfig dhcpd on
Create /etc/dhcpd.conf from samples
/etc/rc.d/init.d/dhcpd on
/sbin/iptables -A INPUT -i eth0 -p tcp --dport 53 -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -p udp --dport 53 -j ACCEPT

The example below allocates in the range –

open up the ports on your machine (careful to only open it up on the internal side if the machine is dual facing).
You could use system-config-securitylevel and add port 53 for TCP and UDP. If you are having problems getting an IP address, check that it’s eth0 (and not say eth1), and if that fails, briefly turn off the firewall while testing.

/etc/dhcpd.conf: you’ll need to edit this to put in the address of your gateway (router), and the ip addresses of your dns servers, and add in any fixed ip address computers at the bottom.

ddns-update-style none;
ddns-updates off;
option T150 code 150 = string;
deny client-updates;
one-lease-per-client false;
allow bootp;
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample

ddns-update-style interim;
ignore client-updates;

subnet netmask {

# — default gateway
option routers;
option subnet-mask;

option nis-domain “mydomain.example.com”;
option domain-name “mydomain.example.com”;

#enter IP addresses of your dns servers (from /etc/resolv.conf)
option domain-name-servers changeme.dns.server.ip, xx.yy,zz.aa;

#option time-offset -18000; # Eastern Standard Time
# option ntp-servers;
# option netbios-name-servers;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp;
default-lease-time 21600;
max-lease-time 43200;

hardware ethernet 00:26:44:72:e9:15;

Leave a Reply