dhcpd
December 31, 2009 Leave a comment
Nainštalujeme si dhcp daemona:
Skopírujeme defaultny config:
Config je úplne jednoduchý a okomentovaný takže s nasatvením by nemal byť problem.
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# — default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option nis-domain “domain.org”;
option domain-name “domain.org”;
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
Ukážka môjho configu:
ignore client-updates;
# — nastavenie ip adresy siete
subnet 10.0.2.0 netmask 255.255.255.0 {
# — nastavenie default gateway
option routers 10.0.2.1;
option subnet-mask 255.255.255.0;
# — nastavenie dns serverov
option nis-domain “virtual.net”;
option domain-name “virtual.net”;
option domain-name-servers 10.0.2.1;
option time-offset -18000; # Eastern Standard Time
# — nastavnie ntp servera
option ntp-servers 10.0.2.5;
# option netbios-name-servers 192.168.1.1;
# — Selects point-to-point node (default is hybrid). Don’t change this unless
# — you understand Netbios very well
# option netbios-node-type 2;
# — nastavenie rozsahu ip adries
range dynamic-bootp 10.0.2.200 10.0.2.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
# host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 207.175.42.254;
# }
# — nastavime pridelovanie ip adresy podla mac adresy a budeme posielat
# hostname dhcpckom
host desktop.virtual.test {
hardware ethernet 00:0C:29:1C:B4:0E;
fixed-address 10.0.50.238;
option host-name “desktop.virtual.test”;
}
}
Pridáme dhcp daemona do prislušných runlevelov a spustime:
#service dhcpd start