Sunday, 20 February 2011

Set up and configure DHCP

Install
[root@dhcp ~]# yum install dhcp -y

Turn on auto
[root@dhcp ~]# chkconfig dhcpd on

Base config
[root@dhcp ~]# cat /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample > /etc/dhcpd.conf

Example Config
ddns-update-style interim;
ignore client-updates;
subnet 192.168.48.0 netmask 255.255.255.0 {
        option routers                  192.168.48.1;
        option subnet-mask              255.255.255.0;
        option domain-name              "example.com";
        option domain-name-servers      192.168.48.2;
        option time-offset              -18000; # Eastern Standard Time
        range 192.168.48.100 192.168.48.120;
        range dynamic-bootp 192.168.48.50 192.168.48.80;
        default-lease-time 21600;
        max-lease-time 43200;
}

Check config
[root@dhcp ~]# service dhcpd configtest

Start Service
[root@dhcp ~]# service dhcpd start

No comments:

Post a Comment