Gentoo 下 DHCP 的設定

目的: 建立起 DHCP server,讓所有接上這個網域的電腦能不需 config 即可連上網路。
說明: DNS 為,domain 為 posiedon。網段為,其中 254 給 server,1 保留,因此分配出去的 IP range 為 2 - 253

首先,安裝 dhcpcd
emerge dhcpcd

接下來,編輯 /etc/dhcp/dhcpd.conf

# dhcpd.conf 
# Sample configuration file for ISC dhcpd 

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

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

# If this DHCP server is the official DHCP server for the local 
# network, the authoritative directive should be uncommented. 

# Use this to send dhcp log messages to a different log file (you also 
# have to hack syslog.conf to complete the redirection). 
log-facility local7; 

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology. 

# A slightly different configuration for an internal subnet. 
subnet netmask { 

最後,啟動 DHCPD
/etc/init.d/dhcpd start

rc-update add dhcpd default