Dhcpd

From LQWiki
(Redirected from Dhcp server)
Jump to navigation Jump to search

dhpcd (Dynamic Host Configuration Protocol Daemon) is a DHCP-daemon which manages dynamic IP addresses. It reads its configuration from /etc/dhcpd.conf. dhcpd keeps track of the current leases in dhcpd.leases, usually located in /var/db. You can usually install dhcpd from your distribution as described under installing software. If this is not possible, download it from www.isc.org.

  # Sample /etc/dhcpd.conf
  ddns-update-style interim;
  authoritative; 
  default-lease-time 600;
  max-lease-time 3600;
  option broadcast-address 192.168.1.255;
  option routers 192.168.1.254;
  option domain-name-servers 192.168.1.1, 192.168.1.2;
  option domain-name "mydomain.net";

  subnet 192.168.1.0 netmask 255.255.255.0 {
     range 192.168.1.10 192.168.1.100;
     range 192.168.1.150 192.168.1.200;
  }

Start your dhcp-server using

/etc/init.d/dhcpd

add a static host

If you want one of your hosts to always get the same IP address, add something like this inside the subnet definition:

host somecomputer { hardware ethernet 0:a1:a1:0:b4:56; fixed-address 10.0.0.1; }

somecomputer is the hostname, the 0:a1 stuff is the MAC address, and 10.0.0.1 is the IP that will always get assigned to it.

See also

  • dhcpcd -- DHCP client daemon
  • named -- DNS service
  • NAT -- network address translation

external links