Software projects/OS/Slackware/Advanced usage/DHCP server

From Pandora Wiki
Revision as of 18:22, 17 April 2012 by Linux-SWAT (talk | contribs) (dhcpd)
Jump to: navigation, search

Dnsmask and dhcpcd

  • I never used Dnsmask. Seems it's great.
  • dhcpcd is the most common dhcp server.

dhcpd

  • Check google for "dhcpcd.conf examples".
  • Here's a simple and understandable configuration:
# dhcpd.conf
 
option domain-name "nom_choisi";

option subnet-mask 255.255.255.0;

option domain-name-servers 217.115.138.24 , 192.168.1.3;
ddns-update-style ad-hoc;

option routers 192.168.1.1;

default-lease-time 86400;

max-lease-time 604800;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option broadcast-address 192.168.1.255;
}

#host PC-1 {
#hardware ethernet 00:00:4C:72:86:68;
#fixed-address 192.168.1.50;
#}
  • Edit /etc/dhcpcd.conf as you need.
  • Note that the network interface has to be configured before running dhcpd on it. So you'll have to comment or remove
/etc/rc.d/rc.networkmanager start

from /etc/rc.d/rc.local , and put something like

ifconfig eth0 11.22.33.44/24

instead, depending on which interface/network address you plan to use.

  • Run dhcpd eth0, dhcpd usb0 or dhcpd usb1 depending which interface you intend to use to deliver dhcp service.
  • Once you got a satisfying configuration, put the command in /etc/rc.d/rc.local , after the fixed adress.