DHCP-Server einrichten

[moR-pH-euS]

Magnum P.I.
Zuerst muss die dhcpd.conf unter /etc erstellt werden. Diese Config-Datei ist ziemlich selbst-
erklaerend.

Code:
root@netbsd-gw# cat /etc/dhcpd.conf 
# global dhcpd parameters
deny unknown-clients;                   #allow unknown connections
ddns-update-style none;                 #disallow dynamic DNS updates

#which network interface the server will listen on
subnet 192.168.1.0 netmask 255.255.255.0 { #the zeros indicate which range


range 192.168.1.5 192.168.1.10;

}                                                  #of addresses are allowed to connect

 #set of parameters common to all clients
  group {
    option broadcast-address 192.168.1.255;
    option domain-name "home";
    option domain-name-servers 194.152.64.35, 194.25.2.132;
    option routers 192.168.1.254;
    option subnet-mask 255.255.255.0;

  #set of parameters specific to one particular host
    host freebsd-wk {
     hardware ethernet <die-entsprechende-mac-adresse>;
     fixed-address 192.168.1.5;
     option host-name "freebsd-wk";              #name of the host (if the fixed address
                                                      #doesn't resolve to a simple name)
 }

  #set of parameters specific to one particular host
     host w2-moni {
      hardware ethernet <die-entsprechende-mac-adresse>;
      fixed-address 192.168.1.6;
      option host-name "w2-moni";              #name of the host (if the fixed address
                                                        #doesn't resolve to a simple name)
 }

    #set of parameters specific to one particular host
       host netbsd-sparc {
        hardware ethernet <die-entsprechende-mac-adresse>;
        fixed-address 192.168.1.7;
        option host-name "netbsd-sparc"; #name of the host (if the fixed address
                                                           #doesn't resolve to a simple name)
}

  #set of parameters specific to one particular host
     host debian-gameserver {
      hardware ethernet <die-entsprechende-mac-adresse>;
      fixed-address 192.168.1.9;
      option host-name "debian-gameserver";              #name of the host (if the fixed address
                                                       #doesn't resolve to a simple name)
 }


}


so sieht sie bei mir aus und erklaert ist alles in den Kommentaren, oben legt ihr die
Globalen Werte fest und dann noch die spezifischen Host-Namen der Maschinen (die Mac-Adressen
muesst ihr noch auf eure abaendern und die Hostnamen und ip's...
In der /etc/rc.conf tragt ihr dann noch folgendes ein:

dhcpd=YES
dhcpd_flags="-q rtk0"

dabei ist rtk0 das interne Interface. Dann koennt ihr den Server auch schon starten
(der Eintrag in der rc.conf ist ja nur dafuer das beim Start des Server der Dienst auch
gestartet wird, aber wir muessen ja nicht immer booten ;-)

root@netbsd-gw# /etc/rc.d/dhcpd start
/etc/rc.d/dhcpd: WARNING: /var/db/dhcpd.leases is not readable.

der Server will dann auch erst starten wenn ihr dieses file angelegt habt (das gilt für netbsd 1.6.x und auch netbsd 2.0.x)

root@netbsd-gw# touch /var/db/dhcpd.leases

danach lief er ohne Probleme. Jetzt muesst ihr nur noch auf den Clients dhcp einstellen und gut is...

bei Fehlern bitte eine pm an mich
 
Zuletzt bearbeitet:
gut, gut.. aber wer nennt denn bitte schön das Betriebssystem gleich im Hostname? :}
 
habe ich mir durch die ausbildung damals angewöhnt... ;-) mein ausbilder hat das auch immer gemacht und jetzt mache ich es so...
 
Zurück
Oben