Nowe posty

Autor Wątek: Instalacja Mandrivy na beznapędowcu  (Przeczytany 9328 razy)

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« dnia: 2010-12-19, 01:31:38 »
Jestem posiadaczem laptopa Toshiba Portege. Byłbym szczęśliwy gdybym miał na nim jakiś system a najlepiej Mandrivę :-) W biosie nie ma możliwości bootowania z USB ani karty SD. Jest tylko z dysku (na którym nic nie ma), z CD-ROMU, którego nie posiadam, FDD (którego nie posiadam), Karty PC (której nie posiadam)i z sieci lokalnej. Tak więc pozostaje pytanie jak?
Korzystałem z tego poradnika:
http://wiki.mandriva.com/en/Docs/Installing_Mandriva_Linux/PXE_Install
Żeby ustawić ip uruchomiłem drakwizard (bo chyba do tego on służy. No i tam wybrałem dhcp-server jak pamiętam i jako najniższy adres ip 192.168.0.10 a jako najwyższy 192.168.0.250. No i PXE załączone tylko co ustawić jako bramę?
Po podłączeniu kabla w liście interfejsów do skonfigurowania pojawia się oprócz eth0 również eth0:9. Gdy wybiorę tą konfigurację to są już wpisane tam domyślne adresy i konfiguracja zakończona zostaje powodzeniem (bez względu na bramę), lecz niestety klient dalej nie może się połączyć.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #1 dnia: 2010-12-19, 19:31:39 »
Mój plik /etc/dhcpd.conf
# for explanation in french go to : http://www.delafond.org/traducmanfr/man/man5/dhcpd.conf.5.html
ddns-update-style none;
allow booting;
allow bootp;

# Your dhcp server is not master on your network !
#not authoritative;
# Your dhcpd server is master on your network !
authoritative;
#not authoritative;

#Interface where dhcpd is active
DHCPD_INTERFACE = "eth0";

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer

# define Option for the PXE class
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

#Define options for pxelinux
option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
site-option-space "pxelinux";
# These lines should be customized to your setup
#option pxelinux.configfile "configs/common";
#option pxelinux.pathprefix "/pxelinux/files/";
#filename "/pxelinux/pxelinux.bin";

option pxelinux.magic f1:00:74:7e;
option pxelinux.reboottime 30;
#if exists dhcp-parameter-request-list {
# Always send the PXELINUX options
# append dhcp-parameter-request-list 208, 209, 210, 211;
# append dhcp-parameter-request-list 208,211;
# }

#Class that determine the options for Etherboot 5.x requests
class "Etherboot" {

#if The vendor-class-identifier equal Etherboot-5.0
match if substring (option vendor-class-identifier, 0, 9) = "Etherboot";

# filename define the file retrieve by the client, there nbgrub
# our tftp is chrooted so is just the path to the file
filename "/etherboot/nbgrub";

#Used by etherboot to detect a valid pxe dhcp server
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer        
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "Etherboot";

vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server ;
}


# create the Class PXE
class "PXE" {
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
 
# filename define the file retrieve by the client, there pxelinux.0
# our tftp is chrooted so is just the path to the file
# If you prefer use grub, use pxegrub compiled for your ethernet card.
#filename "/PXEClient/pxegrub";
filename "/X86PC/linux/linux.0";

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "PXEClient";

 
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server ;
}

# the class know exist just for deny the response to other DHCP request
class "known" {
  match hardware;
  one-lease-per-client on;
  ddns-updates on;
  ddns-domainname = "";
  option domain-name "";
  option domain-name-servers  ;  
  ddns-hostname = pick-first-value(ddns-hostname, option host-name);
  option fqdn.no-client-update on;
  set vendor_class_identifier = option vendor-class-identifier;
}

# TAG: COMPUTER_LIST_BEGIN
#host compute9{
#    hardware ethernet 00:02:b3:3f:7e:b7;
#    fixed-address compute9;
# TAG: COMPUTER_LIST_END

#  subnet 192.168.200.0 netmask 255.255.255.0 {
subnet  netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option routers 255.255.0.0;
  default-lease-time 28800;
  max-lease-time 86400;
  option domain-name "";
  option domain-name-servers  ;
  next-server ;
   
    pool {
       range 128.1.1.2 128.1.1.9;
#       deny members of "PXE";
#       deny members of "Etherboot";
    }

#   pool {
#     range 192.168.200.200 192.168.200.254;
# give an address of the the pool for PXE client and deny the other
#allow members of "PXE";
#deny members of "known";
#allow members of "Etherboot";
#        }
}
No i oto co wypluwa przy komendzie dhcpd:
Internet Systems Consortium DHCP Server 4.1.2
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
/etc/dhcpd.conf line 76: semicolon expected.
}
 ^
/etc/dhcpd.conf line 100: expecting a parameter or declaration
}
 ^
/etc/dhcpd.conf line 122: subnet declarations not allowed here.
subnet
^
/etc/dhcpd.conf line 144: unexpected end of file
}
^
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.
Może to się przyda, zeby udzielić mi pomocy ;-)

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #2 dnia: 2010-12-19, 20:24:30 »
Na szybko: wskazane linie dotyczą wpisów next-server bez adresu. Wtedy klient nie wiedziałby, z jakiego adresu pobierać plik określony w filename (edycja: piszę to z mętnej pamięci wspartej zajrzeniem do man dhcpd.conf - może istnieje domyślny adres, np. adres serwera DHCP).

Jeszcze jedna szybka uwaga: jeśli już serwer DHCP uruchomisz bez błędów w konfigu, to warto odwiedzać dziennik demona dhcpd w razie problemów (w Debianie chyba siedzi domyślnie w /var/log/daemon.log, może w innych dystrybucjach też).

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #3 dnia: 2010-12-19, 22:11:20 »
Wykasowałem ten plik i spróbowałem od nowa programem drakwizard.
/etc/dhcpd.conf
# for explanation in french go to : http://www.delafond.org/traducmanfr/man/man5/dhcpd.conf.5.html
ddns-update-style none;
allow booting;
allow bootp;

# Your dhcp server is not master on your network !
#not authoritative;
# Your dhcpd server is master on your network !
authoritative;
#not authoritative;

#Interface where dhcpd is active
DHCPD_INTERFACE = "eth0:9";

# Definition of PXE-specific options
# Code 1: Multicast IP address of bootfile
# Code 2: UDP port that client should monitor for MTFTP responses
# Code 3: UDP port that MTFTP servers are using to listen for MTFTP requests
# Code 4: Number of secondes a client must listen for activity before trying
#         to start a new MTFTP transfer
# Code 5: Number of secondes a client must listen before trying to restart
#         a MTFTP transfer

# define Option for the PXE class
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option PXE.discovery-control code 6 = unsigned integer 8;
option PXE.discovery-mcast-addr code 7 = ip-address;

#Define options for pxelinux
option space pxelinux;
option pxelinux.magic      code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;
site-option-space "pxelinux";
# These lines should be customized to your setup
#option pxelinux.configfile "configs/common";
#option pxelinux.pathprefix "/pxelinux/files/";
#filename "/pxelinux/pxelinux.bin";

option pxelinux.magic f1:00:74:7e;
option pxelinux.reboottime 30;
#if exists dhcp-parameter-request-list {
# Always send the PXELINUX options
# append dhcp-parameter-request-list 208, 209, 210, 211;
# append dhcp-parameter-request-list 208,211;
# }

#Class that determine the options for Etherboot 5.x requests
class "Etherboot" {

#if The vendor-class-identifier equal Etherboot-5.0
match if substring (option vendor-class-identifier, 0, 9) = "Etherboot";

# filename define the file retrieve by the client, there nbgrub
# our tftp is chrooted so is just the path to the file
filename "/etherboot/nbgrub";

#Used by etherboot to detect a valid pxe dhcp server
option vendor-encapsulated-options 3c:09:45:74:68:65:72:62:6f:6f:74:ff;

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer        
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "Etherboot";

vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 192.168.1.2;
}


# create the Class PXE
class "PXE" {
# if the "vendor-class-identifier" is set to "PXEClient" in the client dhcp request
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
 
# filename define the file retrieve by the client, there pxelinux.0
# our tftp is chrooted so is just the path to the file
# If you prefer use grub, use pxegrub compiled for your ethernet card.
#filename "/PXEClient/pxegrub";
filename "/X86PC/linux/linux.0";

# Set the  "vendor-class-identifier" field to "PXEClient" in dhcp answer
# if this field is not set the pxe client will ignore the answer !
option vendor-class-identifier "PXEClient";

 
vendor-option-space PXE;
option PXE.mtftp-ip 0.0.0.0;

# IP of you TFTP server
next-server 192.168.1.2;
}

# the class know exist just for deny the response to other DHCP request
class "known" {
  match hardware;
  one-lease-per-client on;
  ddns-updates on;
  ddns-domainname = "";
  option domain-name "";
  option domain-name-servers  192.168.1.2;  
  ddns-hostname = pick-first-value(ddns-hostname, option host-name);
  option fqdn.no-client-update on;
  set vendor_class_identifier = option vendor-class-identifier;
}

# TAG: COMPUTER_LIST_BEGIN
#host compute9{
#    hardware ethernet 00:02:b3:3f:7e:b7;
#    fixed-address compute9;
# TAG: COMPUTER_LIST_END

#  subnet 192.168.200.0 netmask 255.255.255.0 {
subnet 192.168.1.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option routers 255.0.0.0;
  default-lease-time 28800;
  max-lease-time 86400;
  option domain-name "";
  option domain-name-servers  192.168.1.2;
  next-server 192.168.1.2;
   
    pool {
       range 192.168.1.65 192.168.1.254;
#       deny members of "PXE";
#       deny members of "Etherboot";
    }

#   pool {
#     range 192.168.200.200 192.168.200.254;
# give an address of the the pool for PXE client and deny the other
#allow members of "PXE";
#deny members of "known";
#allow members of "Etherboot";
#        }
}
Serwer teraz sie uruchamia - komenda dhcpd
Internet Systems Consortium DHCP Server 4.1.2
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 class decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/wlan0/1c:4b:d6:7a:dc:e9/192.168.1.0/24
Sending on   LPF/wlan0/1c:4b:d6:7a:dc:e9/192.168.1.0/24
Sending on   Socket/fallback/fallback-net
There's already a DHCP server running.


get the latest from ftp.isc.org and install that before
[root@localhost michal]# 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.
Niestety na komputerze-kliencie dalej pokazuje komunikat: No DHCP or proxyDHCP offers were received. :/

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #4 dnia: 2010-12-19, 23:04:48 »
Patrz drugi akapit poprzedniego postu.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #5 dnia: 2010-12-20, 11:34:46 »
No właśnie u mnie nie ma takiego pliku i nie wiem gdzie mogą siedzieć logi...

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #6 dnia: 2010-12-20, 14:29:23 »
Jeśli odpalasz dhcpd bezpośrednio, a nie jako usługę (czyli np. za pomocą service dhcpd start), dodaj opcję -d - może komunikaty trafią na wyjście błędów konsoli.

Na razie interesuje nas czy serwer dostał od klienta komunikat DHCPDISCOVER i jak zareagował na niego. Z grubsza możesz poczytać o tym na https://secure.wikimedia.org/wikipedia/pl/wiki/DHCP

Możesz też spróbować po stronie serwera podejrzeć info o pakietach wchodzących na port 67 (tam domyślnie słucha dhcpd, klepnij netstat -nupl dla sprawdzenia): tcpdump -i eth0:9 'port 67' (tcpdump -D wyświetla dostępne dla niego interfejsy).

Zamiast badać logi, można by trochę przeanalizować plik konfiguracyjny, ale chyba łatwiej stworzyć od nowa znacznie prostszą wersję.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #7 dnia: 2010-12-20, 18:14:20 »
Niestety opcja -d nic nie zwraca. Dhcpd jest tak jak napisałeś na pocie 67. Komenda tcpdump pokazuje jakiś ruch przy próbie połączenia:
18:12:14.478005 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:08:0d:90:57:64 (oui Unknown), length 548
18:12:16.592603 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:08:0d:90:57:64 (oui Unknown), length 548
18:12:20.657100 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:08:0d:90:57:64 (oui Unknown), length 548
18:12:28.730950 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:08:0d:90:57:64 (oui Unknown), length 548
18:12:44.823844 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:08:0d:90:57:64 (oui Unknown), length 548
Kurcze, nie wiedziałem, że będzie tyle problemów z instalacją tego systemu przez PXE... :-/

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #8 dnia: 2010-12-20, 20:40:54 »
No dobra: jądro przechwytuje pakiety (nie wiadomo czy jego reguły filtrowania puszczają je dalej), a co od strony 'dhcpd -d' czyli co z logami, gdy klient woła o ofertę?

Też się nagimnastykowałem swego czasu nad takimi przeszkodami, ucząc się sporo przy okazji. Miałem jednak szczęście brać udział w ćwiczeniach na ten temat i sporo kroków do przodu zawdzięczam prowadzącemu (filtrowanie było jedną z takich niespodzianek). Chętnie zrobię z tego użytek, jeśli tylko masz ochotę się potrudzić.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #9 dnia: 2010-12-20, 22:07:48 »
Niestety tylko tyle:
dhcpd -d
Internet Systems Consortium DHCP Server 4.1.2
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 class decls to leases file.
Wrote 0 leases to leases file.
Listening on LPF/wlan0/1c:4b:d6:7a:dc:e9/192.168.1.0/24
Sending on   LPF/wlan0/1c:4b:d6:7a:dc:e9/192.168.1.0/24
Sending on   Socket/fallback/fallback-net
There's already a DHCP server running.

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.

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #10 dnia: 2010-12-21, 00:39:32 »
Poniżej trzech nieistotnych akapitów znajduje się exiting... Wyżej: "There's already a DHCP server running". Skoro już jakiś działa (być może odpalony na starcie jako usługa) i nie wychodzi po załadowaniu tego dhcpd.conf, to po co ładować ręcznie jeszcze jeden. Sprawdź to poleceniem pgrep dhcpd, ale i wspomnianym wyżej netstatem. Spróbuj zagadać klientem do tego działającego. Jeśli Twoja maszyna działa od początku zabawy, zrestartuj lub przeładuj usługę.

Dopiero po tym czas przejrzeć plik konfiguracyjny.

P.S. Może w wolnej chwili spróbuję zająć się tym mniej powierzchownie i sam postawię dhcpd na tym pliku.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #11 dnia: 2010-12-21, 10:49:54 »
Tak, miałeś rację, serwer DHCP był już odpalony. Spróbowałem znaleźć inną droge do rozwiązania tego problemu i sięgnąłem do tego poradnika: http://www.losoft.org/blog/2009/11/instalacja-ubuntu-9-10-przez-lan-pxe-install/
Wszystko niby idzie ok, lecz gdy daję tftp 192.168.1.1 -c get pxelinux.0 to wyświetla się
Transfer timed out.
Na kliencie komunikat No boot filename received.

arctgx

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #12 dnia: 2010-12-21, 22:58:55 »
Rozumiem, że serwer DHCP daje już adres jak trzeba i to mamy z głowy.

Sprawdź pozwolenia w /etc/hosts.allow i /etc/hosts.deny, zarówno dla maszyny, z której testowo próbujesz pobrać, jak i dla tej docelowej.

Jedna rzecz naprzód. Jeśli pracujesz na ostatnim konfigu, spróbuj linię
filename "/X86PC/linux/linux.0";
umieścić w sekcji subnet (i przeładować dhcpd). Z braku czasu nie wnikam, do czego służy linia
option PXE.mtftp-ip 0.0.0.0;
i czy warto ją też tam przenieść.

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #13 dnia: 2010-12-25, 12:30:57 »
Niestety nie wystarczyło mi cierpliwości i zrobiłem tak. Ściągnąłem i odpaliłem Slakaa z LiveUSB na komputerze-serwerze. Ma on opcje serwera PXE i z niej skorzystałem. System ładnie odpalił się przez sieć na moim komputerze. Potem na kliencie ściągnąłem wersje Slaksa w formacie LiveUSB i zainstalowałem ją tylko zamiast pendriva wykorzystałem własny dysk. Co prawda system działa trochę mało stabilnie i denerwuje mnie, że nie mogę ustawić rozdzielczości większej niż 800x600 ale chociaż mam jakiś system :)

energizer

  • Gość
Instalacja Mandrivy na beznapędowcu
« Odpowiedź #14 dnia: 2010-12-25, 23:00:56 »
Może ktoś zna inne dystrybucje typu LiveCD posiadające od razu serwer PXE tak jak Slax?