Difference between revisions of "Software projects/OS/Slackware/Advanced usage/DHCP server"

From Pandora Wiki
Jump to: navigation, search
(Created page with "= 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". * Edit /etc/dhcpcd...")
 
(dhcpd)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Dnsmask and dhcpcd =
+
= Dnsmask and dhcpd =
 
* I never used Dnsmask. Seems it's great.
 
* I never used Dnsmask. Seems it's great.
* dhcpcd is the most common dhcp server.
+
* dhcpd is the most common dhcp server.
  
 
= dhcpd =
 
= dhcpd =
* Check google for "dhcpcd.conf examples".
+
* Check google for "dhcpd.conf examples".
* Edit /etc/dhcpcd.conf as you need.
+
* 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/dhcpd.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
 
* 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
 
  /etc/rc.d/rc.networkmanager start
 
from /etc/rc.d/rc.local , and put something like
 
from /etc/rc.d/rc.local , and put something like
 
  ifconfig eth0 11.22.33.44/24
 
  ifconfig eth0 11.22.33.44/24
instead, depending on which network address you plan to use.
+
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.
 
* 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.
 
* Once you got a satisfying configuration, put the command in /etc/rc.d/rc.local , after the fixed adress.
 +
 +
 +
 +
[[Category:Network]]
 +
[[Category:Slackware]]
 +
[[Category:System]]

Latest revision as of 01:21, 6 May 2012

Dnsmask and dhcpd

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

dhcpd

  • Check google for "dhcpd.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/dhcpd.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.