Gentoo Wiki





This HOWTO is intended to describe how to get a Gentoo box configured as a DHCP server.


This HOWTO describes how to setup the DHCP server on Gentoo, but does not cover how to setup the client machines. This HOWTO assumes Gentoo 2005.1, but is likely to work with other versions.



Dynamic Host Control Protocol.
Network Interface Card, commonly an Ethernet ISA/PCI card.
Domain Name System



For a DHCP server you will need to emerge dhcp:

emerge dhcp


A freshly emerged dhcp will contain a sample configuration file (/etc/dhcp/dhcpd.conf.sample). This file can be copied to /etc/dhcp/dhcpd.conf and used as the basis of the configuration.

The example shown below is typical for a small network. It contains a definition for the subnet, plus the hosts you want to assign a specific details such as IP address.

File: /etc/dhcp/dhcpd.conf
# dhcp.conf
# Sample DHCP Server Configuration File

# option definitions common to all supported networks...
option domain-name "internal";
option domain-name-servers,;
option routers;
ddns-update-style none;


default-lease-time 600;
max-lease-time 7200;

subnet netmask {
# If you want to provided WINS Server
  option netbios-name-servers;
  option netbios-node-type 8;


# example for a address that will be given to a fixed hardware (mac)

host laptop {
  hardware ethernet 00:10:5a:2e:56:a7;
  option routers;
  option broadcast-address;

This configuration file is described below:

Global organisation-wide domain name.

Global organisation-wide domain name servers, comma separated.

The default gateway address.

none: This tells the dhcp server not to update dns

The MAC address of the clients NIC.

A DHCP server can actually run with other DHCP servers on the subnet. But if you want this one to be the one that everyone should look for in case of address collisions, then add authoritative to part of your config file, preferably the first line.

If setting up your DHCP server to accept DHCP requests for clients booting over the network, add those two entries somewhere (one per line) to your config. Likely you'll need more than just those.

If you want your DHCP server to send messages to a system logger other than the local machine, use this setting here. You'll have to setup your system logger (running on the ip address specified) to listen to remote logging.

Which IP you want your NETBIOS to be provided or broadcast to all Windows Client. Windows client will refer to this server for NETBIOS name resolve.

What type of NETBIOS Server is this?

<Type ID>

1 B-node: Broadcast - no WINS

2 P-node: Peer - WINS only

4 M-node: Mixed - broadcast, then WINS

8 H-node: Hybrid - WINS, then broadcast

For lots more options and explanations, see man dhcpd.conf and man dhcp-options

Starting the server

/etc/init.d/dhcpd start
rc-update add dhcpd default
Retrieved from ""

Last modified: Mon, 04 Aug 2008 17:40:00 +0000 Hits: 38,794