DHCP server
# emerge dhcp
Edit /etc/dhcp/dhcpd.conf
# emerge dhcp
Configuration
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 192.168.2.1, 192.168.2.130;
option routers 192.168.2.1;
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.128;
}
# example for a address that will bee given to a fixed hardware (mac)
host laptop {
hardware ethernet 00:10:5a:2e:56:a7;
fixed-address 192.168.2.4;
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
}
This configuration file is described below:
- domain-name
Global organisation-wide domain name.
- domain-name-servers
Global organisation-wide domain name servers, comma separated.
- routers
The default gateway address.
* ddns-update-style
none: This tells the dhcp server not to update dns
* hardware ethernet
The MAC address of the clients NIC.
- authoritative
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.
- allow booting and allow bootp
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.
- option log-servers <ip-address>
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.
For lots more options and explanations, see man dhcpd.conf
http://gentoo-wiki.com/HOWTO_setup_DHCP »
[Click to add or edit comments])
Please prepend comments below including a date