[Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Serwery i sieci oparte na Slackware, wszelkiego rodzaju usługi, troubleshooting.

Moderatorzy: Moderatorzy, Administratorzy

Awatar użytkownika
marco70
Moderator
Posty: 1110
Rejestracja: 2006-10-26, 19:03
Lokalizacja: K...l
Kontakt:

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: marco70 »

Zobacz tak

Kod: Zaznacz cały

authoritative;
option domain-name "local2";
option nis-domain "local2";
default-lease-time 86400 ;
max-lease-time 86400 ;

subnet 192.168.2.0 netmask 255.255.255.0 {
 range 192.168.2.20 192.168.2.22;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.2.255;
 option routers 192.168.2.1;
 option domain-name-servers 192.168.2.1;

 host basia {
  hardware ethernet 00:16:D3:8F:E6:9D;
  fixed-address 192.168.2.2;
 }

}

subnet 192.168.4.0 netmask 255.255.255.0 {
 range 192.168.4.40 192.168.4.44;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.4.255;
 option routers 192.168.4.1;
 option domain-name-servers 192.168.4.1;
 }

} 

subnet 192.168.8.0 netmask 255.255.255.0 {
 range 192.168.8.80 192.168.8.80;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.8.255;
 option routers 192.168.8.1;
 option domain-name-servers 192.168.8.1;
 }

}
Ostatnio zmieniony 2008-11-26, 09:35 przez marco70, łącznie zmieniany 1 raz.
slackware64-15.0
Awatar użytkownika
freak117
Użytkownik
Posty: 250
Rejestracja: 2006-12-13, 21:26
Lokalizacja: z sieci

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: freak117 »

mie_mode pisze:niestety też nie, kurcze no nie umiem sobie z tym poradzić, może ktos ma podobny pilk na 3 podsieci? :(
Coś mnie dziwią te błędy - skoro są wszystkie średniki to nie wiem dlaczego dalej krzyczy, że ich brakuje. Moja rada - dodawaj linijka po linijce parametry do tego pliku i zobaczysz co tak na prawdę powoduje, że to nie chce się uruchomić.
A jeśli chcesz przykładowy konfig to mój dla dwóch podsieci wygląda tak:

Kod: Zaznacz cały

option domain-name "domenka";
option domain-name-servers 1.2.3.4, 1.2.3.5;
ddns-update-style none;
default-lease-time 86400;
max-lease-time 86400;

subnet 192.168.0.0 netmask 255.255.255.0 {
        range 192.168.0.2 192.168.0.5;
        option routers 192.168.0.1;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.0.255;

        host host1 {
                hardware ethernet 00:11:22:33:44:55;
                fixed-address 192.168.0.2;
        }

        host host2 {
                hardware ethernet 11:22:33:44:55:66;
                fixed-address 192.168.0.3;
        }
}

subnet 192.168.1.0 netmask 255.255.255.0 {
        range 192.168.1.2 192.168.1.127;
        option routers 192.168.1.1;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.1.255;

        host host4 {
                hardware ethernet 22:33:44:55:66:77;
                fixed-address 192.168.1.4;
        }

        host host5 {
                hardware ethernet 33:44:55:66:77:88;
                fixed-address 192.168.1.2;
        }
}
W3 rulez ;D
Awatar użytkownika
mie_mode
Użytkownik
Posty: 130
Rejestracja: 2008-03-01, 10:57
Lokalizacja: bin/bash
Kontakt:

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: mie_mode »

marco70, oto błedy przy twojej propozycji :

Kod: Zaznacz cały

Internet Systems Consortium DHCP Server V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
/etc/dhcpd.conf line 22: semicolon expected.
 }
 ^
/etc/dhcpd.conf line 26: subnet declarations not allowed here.
subnet
^
/etc/dhcpd.conf line 36: subnet declarations not allowed here.
subnet
^
Configuration file errors encountered -- exiting

If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.

If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.

Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.

exiting.


[ Dodano: 2008-11-26, 15:02 ]
freak117, twój na dwa działa pieknie, zaraz zrobie modyfikacje na trzy i zobaczymy czy zadziała, bo normalnie mnie krew zalewa dhcp w 3 minuty sie stawia a ja sie juz 24h mecze z tym :/

[ Dodano: 2008-11-26, 15:34 ]
freak117, powieliłem twoj plik dodajac identyczną trzecia grupe i dziala super, dzięki, widocznie cos z odstępami tych nawaiasow bylo :/ co jest moim zdaniem chodze.

Kazdy kto pomagał mi z tymi nawiasami dostaje punkcik :)
Intel Xeon E3 1225 QUAD@3.1
32GB DDRIII 1333Mhz
Gigabyte GA-H67MA-B3
2x250GB MAXTOR SATAII@7200 as RAID1

SSD incoming...
Awatar użytkownika
marco70
Moderator
Posty: 1110
Rejestracja: 2006-10-26, 19:03
Lokalizacja: K...l
Kontakt:

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: marco70 »

A wiec tak przetestowałem to u siebie i brakowało ddns-update-style ad-hoc; lub ddns-update-style none; i skasowałem dwie klamry.

Kod: Zaznacz cały

authoritative;
ddns-update-style ad-hoc;
option domain-name "local2";
option nis-domain "local2";
default-lease-time 86400 ;
max-lease-time 86400 ;

subnet 192.168.2.0 netmask 255.255.255.0 {
 range 192.168.2.20 192.168.2.22;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.2.255;
 option routers 192.168.2.1;
 option domain-name-servers 192.168.2.1;

 host basia {
  hardware ethernet 00:16:D3:8F:E6:9D;
  fixed-address 192.168.2.2;
 }

}

subnet 192.168.4.0 netmask 255.255.255.0 {
 range 192.168.4.40 192.168.4.44;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.4.255;
 option routers 192.168.4.1;
 option domain-name-servers 192.168.4.1;
}

subnet 192.168.8.0 netmask 255.255.255.0 {
 range 192.168.8.80 192.168.8.80;
 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.8.255;
 option routers 192.168.8.1;
 option domain-name-servers 192.168.8.1;
}
tak u mnie działa bez błędów.
Ostatnio zmieniony 2008-11-26, 17:56 przez marco70, łącznie zmieniany 1 raz.
slackware64-15.0
darasx
Użytkownik
Posty: 7
Rejestracja: 2008-11-27, 21:19

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: darasx »

Hm, u mnie na wielu kartach przechodzi coś takiego (przerobiłem dla Twojej sieci):

Kod: Zaznacz cały

# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#

authoritative;
option domain-name "local2";
option nis-domain "local2";
default-lease-time 86400 ;
max-lease-time 86400 ; 


shared-network siec_1{
 subnet 192.168.2.0 netmask 255.255.255.0 { 
  range 192.168.2.20 192.168.2.22; 
  option subnet-mask 255.255.255.0; 
  option broadcast-address 192.168.2.255; 
  option routers 192.168.2.1; 
  option domain-name-servers 192.168.2.1;
 }
}

shared-network siec_2{
 subnet 192.168.4.0 netmask 255.255.255.0 { 
  range 192.168.4.40 192.168.4.44; 
  option subnet-mask 255.255.255.0; 
  option broadcast-address 192.168.4.255; 
  option routers 192.168.4.1; 
  option domain-name-servers 192.168.4.1; 
 }
}

shared-network siec_3{
 subnet 192.168.8.0 netmask 255.255.255.0 {
  range 192.168.8.80 192.168.8.81;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.8.255;
  option routers 192.168.8.1;
  option domain-name-servers 192.168.8.1;
 }

}


 host basia {
  hardware ethernet 00:16:D3:8F:E6:9D;
  fixed-address 192.168.2.2;
 }
  
Po za tym - czemu w sieci na "8" masz tylko jeden host w range? zwiększyłem o jeden zakres
Ostatnio zmieniony 2008-12-03, 22:13 przez darasx, łącznie zmieniany 2 razy.
Darasx
edi
Użytkownik
Posty: 52
Rejestracja: 2007-05-09, 13:08

Re: [Rozw.] DHCP na trzy podsieci, przykładowy dhcpd.conf

Post autor: edi »

proszę :

Kod: Zaznacz cały

 dhcpd.conf #
ddns-update-style none;

### PODSIEC 1 #######################################

shared-network my_shared_net {

subnet 192.168.104.0 netmask 255.255.255.0 {
authoritative;
option domain-name "domena.pl";
option domain-name-servers 192.168.104.1;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.104.255;
option routers 192.168.104.1;
option netbios-name-servers 192.168.104.1;
default-lease-time 86400;
max-lease-time 172800;

host PRZYKLADOWY {
hardware ethernet 00:00:00:00:00:00;
fixed-address 192.168.104.2;
}
}
################## PODSIEC 2 ######################
subnet 192.168.105.0 netmask 255.255.255.0 {
authoritative;
option domain-name "domena.pl";
option domain-name-servers 192.168.105.1;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.105.255;
option routers 192.168.105.1;
option netbios-name-servers 192.168.105.1;
default-lease-time 86400;
max-lease-time 172800;

host PRZYKALDOWY2 {
hardware ethernet 00:10:E0:11:C0:00;
fixed-address 192.168.105.2;
}
}
############### PODSIEC 3 ################
subnet 192.168.106.0 netmask 255.255.255.0 {
authoritative;
option domain-name "domena.pl";
option domain-name-servers 192.168.106.1;

option subnet-mask 255.255.255.0;
option broadcast-address 192.168.106.255;
option routers 192.168.106.1;
option netbios-name-servers 192.168.106.1;
default-lease-time 86400;
max-lease-time 172800;

host PRZYKLADOWY3 {
hardware ethernet 00:1D:7D:A9:39:DC;
fixed-address 192.168.106.2;
}
}
}
# trzecim nawiasem(klamerka) zamykamy cale my_shared_net
# mozna w ten sposob odpalic tyle podsieci ile nam trzeba. pamietamy ze ostateczny "}"
# dajemy na koncu konfiga
Ostatnio zmieniony 2008-12-07, 17:17 przez edi, łącznie zmieniany 1 raz.
ODPOWIEDZ