[CentOS] DHCP static hosts and subnet configuration

John jses27 at gmail.com
Fri Oct 17 19:15:00 UTC 2008


See "man dhcpd" for the details, but I think it would be something like:

# dhcpd -cf /etc/dhcpd-subnetA.conf -lf
/var/lib/dhcpd/dhcpd-subnetA.leases -pf /var/run/dhcpd-subnetA.pid eth0
# dhcpd -cf /etc/dhcpd-subnetB.conf -lf
/var/lib/dhcpd/dhcpd-subnetB.leases -pf /var/run/dhcpd-subnetB.pid Eth1
-------
JohnStanley Writes:
This works with two NIC CARDS... "dhcp.conf" I promise I really thought I
had posted this earlier but apparently I did not. Filipe is correct for the
cmd line running of it, so heres the .conf to run with two nics.

ddns-update-style ad-hoc

subnet 192.168.2.0 netmask 255.255.255.0 {
    range 192.168.2.XX 192.168.2.XX;
    default-lease-time 7200;
    max-lease-time 21600;
    option routers 192.168.2.XXX;
    option ip-forwarding off;
    option broadcast-address 192.168.2.255;
    option subnet-mask 255.255.255.0;
    option domain-name-servers 64.XX.XX.XX, 64.XX.XX.XX;
  }

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.XX 192.168.1.XX;
    min-secs 3;
    default-lease-time 7200;
    max-lease-time 21600;
    option routers 192.168.1.X;
    option ip-forwarding off;
    option broadcast-address 192.168.1.255;
    option subnet-mask 255.255.255.0;
    option domain-name-servers 64.XX.XX.XX, 64.XX.XX.XX;
  }

Option to run with two nics from the command line as 2 deamons...

dhcpd -cf /etc/dhcpd-network1 eth0
dhcpd -cf /etc/dhcpd-network2 eth1



More information about the CentOS mailing list