Dlaczego nie mogę uruchomić isc-dhcp-server podczas instalacji?


13

Postępuję zgodnie z tym samouczkiem, aby zainstalować system Linux w systemie, który nie ma czytnika CD ani funkcji rozruchu USB. W końcu dotarłem do punktu, w którym musiałem zainstalować isc-dhcp-serveri tak zrobiłem.

Aptmówi mi, że jest jeden częściowo zainstalowany pakiet. Uruchamiam sudo apt-get install -fi otrzymuję:

Job for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp server.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
dpkg: error processing package isc-dhcp-server (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
isc-dhcp-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Jeśli to zrobię, /etc/init.d/isc-dhcp-server startmonit składa się z dwóch pierwszych wierszy tego samego komunikatu.

Wyjście z sudo systemctl status isc-dhcp-server:

● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server)
   Active: failed (Result: exit-code) since Fri 2014-12-12 13:19:25 CST; 2min 43s ago
  Process: 1677 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

Dec 12 13:19:23 semplice dhcpd[1684]: you want, please write a subnet declaration
Dec 12 13:19:23 semplice dhcpd[1684]: in your dhcpd.conf file for the network segment
Dec 12 13:19:23 semplice dhcpd[1684]: to which interface eth0 is attached. **
Dec 12 13:19:23 semplice dhcpd[1684]: 
Dec 12 13:19:23 semplice dhcpd[1684]: 
Dec 12 13:19:25 semplice isc-dhcp-server[1677]: Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
Dec 12 13:19:25 semplice isc-dhcp-server[1677]: failed!
Dec 12 13:19:25 semplice systemd[1]: isc-dhcp-server.service: control process exited, code=exited status=1
Dec 12 13:19:25 semplice systemd[1]: Failed to start LSB: DHCP server.
Dec 12 13:19:25 semplice systemd[1]: Unit isc-dhcp-server.service entered failed state.

Wyjście z sudo journalctl -xn:

-- Logs begin at Fri 2014-12-12 12:57:16 CST, end at Fri 2014-12-12 13:32:01 CST. --
Dec 12 13:31:58 semplice NetworkManager[505]: <info>   lease time 86400
Dec 12 13:31:58 semplice NetworkManager[505]: <info>   nameserver '192.168.1.254'
Dec 12 13:31:58 semplice NetworkManager[505]: <info>   domain name 'lan'
Dec 12 13:31:58 semplice dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.ser
Dec 12 13:31:58 semplice dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 13:31:58 semplice nm-dispatcher[2194]: Dispatching action 'dhcp4-change' for wlan0
Dec 12 13:31:58 semplice dhclient[616]: bound to 192.168.1.65 -- renewal in 45 seconds.
Dec 12 13:31:58 semplice NetworkManager[505]: bound to 192.168.1.65 -- renewal in 45 seconds.
Dec 12 13:32:01 semplice sudo[2197]: alejandro : TTY=pts/0 ; PWD=/home/alejandro ; USER=root ; COMMAND=/bin/journalctl -xn
Dec 12 13:32:01 semplice sudo[2197]: pam_unix(sudo:session): session opened for user root by alejandro(uid=0)

To jest mój /etc/dhcp/dhcpd.configplik, który jest tylko kopią przykładu z wyżej wspomnianego samouczka.

Wyjście z /var/log/syslogodczytu natychmiast po uruchomieniuapt-get install -f

Dec 12 16:42:40 localhost dhclient: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:42:40 localhost NetworkManager[505]: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:42:40 localhost dhclient: DHCPACK from 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: DHCPACK from 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info> (wlan0): DHCPv4 state changed renew -> renew
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   address 192.168.1.65
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   plen 24 (255.255.255.0)
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   gateway 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   server identifier 192.168.1.254
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   lease time 86400
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   nameserver '192.168.1.254'
Dec 12 16:42:40 localhost NetworkManager[505]: <info>   domain name 'lan'
Dec 12 16:42:40 localhost dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Dec 12 16:42:40 localhost dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 16:42:40 localhost nm-dispatcher: Dispatching action 'dhcp4-change' for wlan0
Dec 12 16:42:41 localhost dhclient: bound to 192.168.1.65 -- renewal in 52 seconds.
Dec 12 16:42:41 localhost NetworkManager[505]: bound to 192.168.1.65 -- renewal in 52 seconds.
Dec 12 16:43:32 localhost dhclient: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:43:32 localhost NetworkManager[505]: DHCPREQUEST on wlan0 to 192.168.1.254 port 67
Dec 12 16:43:32 localhost dhclient: DHCPACK from 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: DHCPACK from 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info> (wlan0): DHCPv4 state changed renew -> renew
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   address 192.168.1.65
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   plen 24 (255.255.255.0)
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   gateway 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   server identifier 192.168.1.254
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   lease time 86400
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   nameserver '192.168.1.254'
Dec 12 16:43:32 localhost NetworkManager[505]: <info>   domain name 'lan'
Dec 12 16:43:32 localhost dbus[518]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Dec 12 16:43:32 localhost dbus[518]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec 12 16:43:32 localhost nm-dispatcher: Dispatching action 'dhcp4-change' for wlan0
Dec 12 16:43:33 localhost dhclient: bound to 192.168.1.65 -- renewal in 54 seconds.
Dec 12 16:43:33 localhost NetworkManager[505]: bound to 192.168.1.65 -- renewal in 54 seconds.
Dec 12 16:43:40 localhost dhcpd: Internet Systems Consortium DHCP Server 4.3.1
Dec 12 16:43:40 localhost dhcpd: Copyright 2004-2014 Internet Systems Consortium.
Dec 12 16:43:40 localhost dhcpd: All rights reserved.
Dec 12 16:43:40 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 12 16:43:40 localhost dhcpd: Internet Systems Consortium DHCP Server 4.3.1
Dec 12 16:43:40 localhost dhcpd: Copyright 2004-2014 Internet Systems Consortium.
Dec 12 16:43:40 localhost dhcpd: All rights reserved.
Dec 12 16:43:40 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 12 16:43:40 localhost dhcpd: Wrote 0 deleted host decls to leases file.
Dec 12 16:43:40 localhost dhcpd: Wrote 0 new dynamic host decls to leases file.
Dec 12 16:43:40 localhost dhcpd: Wrote 0 leases to leases file.
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
Dec 12 16:43:40 localhost dhcpd: ** Ignoring requests on eth0.  If this is not what
Dec 12 16:43:40 localhost dhcpd:    you want, please write a subnet declaration
Dec 12 16:43:40 localhost dhcpd:    in your dhcpd.conf file for the network segment
Dec 12 16:43:40 localhost dhcpd:    to which interface eth0 is attached. **
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: Not configured to listen on any interfaces!
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: If you think you have received this message due to a bug rather
Dec 12 16:43:40 localhost dhcpd: than a configuration issue please read the section on submitting
Dec 12 16:43:40 localhost dhcpd: bugs on either our web page at www.isc.org or in the README file
Dec 12 16:43:40 localhost dhcpd: before submitting a bug.  These pages explain the proper
Dec 12 16:43:40 localhost dhcpd: process and the information we find helpful for debugging..
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: exiting.
Dec 12 16:43:42 localhost isc-dhcp-server[5729]: Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!
Dec 12 16:43:42 localhost isc-dhcp-server[5729]: failed!
Dec 12 16:43:42 localhost systemd[1]: isc-dhcp-server.service: control process exited, code=exited status=1
Dec 12 16:43:42 localhost systemd[1]: Failed to start LSB: DHCP server.
Dec 12 16:43:42 localhost systemd[1]: Unit isc-dhcp-server.service entered failed state.

Czy powinienem ukryć mój adres IP?


1
Czy zrobiłeś co do tych dwóch wierszy, tj. Uruchom systemclt i spójrz na dziennik? Proszę zamieścić dane wyjściowe z journalctl -xnwygenerowanego (być może trzeba go sudo) podczas próby ponownego uruchomieniaapt-get install -f
Anthon

1
Więc to się dhcpdnie zaczyna, a my otrzymujemy tylko koniec jego wiadomości. Wygląda na to, że narzeka na dhcpd.confbrak niektórych wymaganych informacji. Musisz przejść nieco dalej w dziennikach systemowych, aby zobaczyć całą serię wiadomości od dhcpd. W tradycyjnym systemie dzienniki powinny się znajdować /var/log/syslog, nie wiem, czy systemd to popsuje.
Gilles „SO- przestań być zły”,

Odpowiedzi:


5

Wygląda na to, że konfiguracja sieci nie jest zgodna z deklaracją podsieci w pliku dhcp.conf. Upewnij się, że masz skonfigurowany adres IP z podsieci 10.10.1.0/24. Możesz to sprawdzić za pomocą:

ip a

Jeśli nie widzisz takiego adresu IP, spróbuj dodać go np. Do eth0:

ip a a 10.10.1.200/24 dev eth0

Następnie spróbuj ponownie naprawić pakiet:

apt-get install -f

Jeśli mam rację, powinien zainstalować pakiet i uruchomić demona DHCP, a może chcesz zachować ten adres IP w / etc / network / interfaces


2
Uwaga: ip a aoznaczaip address add
mxmlnkn

Miałem ten błąd na moim Rasp pi i nie mogłem uruchomić usługi, okazało się, że nie ma adresu IP w wyjściu polecenia ip. po dodaniu adresu IP wszystko działało
Manny265,

@ Manny265 Twój komentarz nie ma sensu; powodem uruchomienia DHCP jest to, że powinien on przypisać ci adres IP automatycznie.
tripleee

3

Twój problem jest tutaj:

Dec 12 16:43:40 localhost dhcpd: No subnet declaration for eth0 (no IPv4 addresses).
Dec 12 16:43:40 localhost dhcpd: ** Ignoring requests on eth0.  If this is not what
Dec 12 16:43:40 localhost dhcpd:    you want, please write a subnet declaration
Dec 12 16:43:40 localhost dhcpd:    in your dhcpd.conf file for the network segment
Dec 12 16:43:40 localhost dhcpd:    to which interface eth0 is attached. **
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: Not configured to listen on any interfaces!
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: If you think you have received this message due to a bug rather
Dec 12 16:43:40 localhost dhcpd: than a configuration issue please read the section on submitting
Dec 12 16:43:40 localhost dhcpd: bugs on either our web page at www.isc.org or in the README file
Dec 12 16:43:40 localhost dhcpd: before submitting a bug.  These pages explain the proper
Dec 12 16:43:40 localhost dhcpd: process and the information we find helpful for debugging..
Dec 12 16:43:40 localhost dhcpd: 
Dec 12 16:43:40 localhost dhcpd: exiting.

Powinieneś być w stanie odtworzyć komunikat o błędzie poprzez uruchomienie dhcpd -t -cf /etc/dhcp/dhcpd.conf.


Zgaduję, że chcesz udostępnić bezprzewodowe połączenie internetowe innym hostom w sieci Ethernet, jak na poniższym schemacie topologii.

                            ↑
                            │ Uplink
                            │
               ┌────────────┴────────────┐
               │          wlan0          │
               │     192.168.1.65/24     │
               │                         │
               │        semplice         │
               │                         │
               │       10.10.1.1/24      │
               │          eth0           │
               └────────────┬────────────┘
                            │
     ┌──────────────┬───────┴────────┬──────────────┐
     │              │                │              │
   Host 1         Host 2           Host 3         Host 4
 10.10.1.21     10.10.1.22       10.10.1.23     10.10.1.24

Zakładam, że adres twojego serwera eth0to 10.10.1.1. Sprawdź to, uruchamiając ip addr show dev eth0.

Następnie musisz skonfigurować /etc/dhcp/dhcpd.conf przekazywanie adresów w eth0interfejsie. Po wyjęciu z pudełka dhcpdjest skonfigurowany tak, aby na nic nie odpowiadał, ponieważ przypadkowo uruchomiony nieuczciwy serwer DHCP siałby spustoszenie w sieci, przekazując adresy każdemu hostowi, który o to poprosi.

W /etc/dhcp/dhcpd.confbędzie potrzebna zwrotka taka jak poniżej:

subnet 10.10.1.0 netmask 255.255.255.0 {
    option subnet-mask        255.255.255.0;
    option broadcast-address  10.10.1.255;
    option routers            10.10.1.1;
    pool {
        range 10.10.1.21 10.10.1.254;
    }
}

... oprócz deklaracji, takich jak authoritative, domain-name, domain-name-servers, i default-lease-time. (W razie potrzeby dostosuj. Tylko Ty wiesz, jakie ustawienia sieci chcesz uzyskać).

Ponadto w przypadku Debiana musisz edytować, /etc/default/isc-dhcp-serveraby ustawić

INTERFACES="eth0"

tak aby serwer nasłuchiwał na porcie Ethernet. (Nie chcesz nasłuchiwać wlan0; bezprzewodowy punkt dostępowy byłby odpowiedzialny za przekazywanie adresów klientom bezprzewodowym).


2
Jego problem polega na tym, że systemd ignoruje informacje o inicjalizacji lsb starego skryptu init, która wyraźnie stwierdza „# Required-Start: $ remote_fs $ network $ syslog”. Zamiast czekać na jednostki sieciowe, uruchomi się, równolegle uruchomi dhcpd, aby uruchomić jeszcze wcześniej.
Florian Heigl,

/etc/dhcp/dhcpd.confDo rozwiązania tego problemu należy użyć prawidłowego pliku konfiguracyjnego. isc-dhcp-serverUsługa zawiedzie stosując niewłaściwą dhcpd.confkonfigurację.
GAD3R,
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.