Tuesday 15 July 2014

Configuring DHCP In Linux (CentOS) With Multiple Scope Multiple NICs



If you want to configure DHCP on CentOS for different ranges and different network cards, you can follow the below steps.

Configuring DHCP in CentOS is not that hard as it seems...!!!

1) Install DHCP server packages, "yum install dhcp".

2) Open /etc/dhcp/dhcpd.conf file and paste the below lines and save it.
ddns-update-style interim;
ignore client-updates;
#set default lease time
default-lease-time 43200;
#set max lease time
max-lease-time 86400;
#set domain name
option domain-name                "<domain name>";
#set sns server ips
option domain-name-servers        <dns ip1>, <dns ip2>;
#set time offset
option time-offset                -18000;
# for range 172.16.1.100 to 172.16.1.200
subnet 172.16.0.0 netmask 255.255.0.0 {
#specify interface
interface eth1;
option routers                    172.16.1.1;
option subnet-mask                255.255.0.0;
range dynamic-bootp 172.16.1.100 172.16.1.200;
}
# for range 192.168.100.100 to 192.168.100.200
subnet 192.168.100.0 netmask 255.255.255.0 {
interface eth0;
option routers                    192.168.100.1;
option subnet-mask                255.255.255.0;
range dynamic-bootp 192.168.100.100 192.168.100.200;
}

3) Start dhcp service "service dhcpd start".

4) Run "chkconfig --levels 235 dhcpd on"

No comments:

Post a Comment