Strona 1 z 2

[+] Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 09:43
autor: dominbdg
Witam,

Mam taki problem z właściwie bardzo prostą usługą jaką jest serwer dhcp.
instalowałem dhcp jako

Kod: Zaznacz cały

apt install isc-dhcp-server
Moja konfiguracja jest taka:

/etc/default/isc-dhcp-server

Kod: Zaznacz cały

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="10.10.0.1"
#INTERFACESv6=""
ifconfig:

Kod: Zaznacz cały

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.0.1  netmask 255.255.255.128  broadcast 10.10.0.127
        inet6 fe80::dea6:32ff:fe12:a40a  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:12:a4:0a  txqueuelen 1000  (Ethernet)
        RX packets 224303  bytes 24096749 (22.9 MiB)
        RX errors 0  dropped 2  overruns 0  frame 0
        TX packets 392102  bytes 477556618 (455.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 88  bytes 7498 (7.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88  bytes 7498 (7.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.8.102  netmask 255.255.255.0  broadcast 192.168.8.255
        inet6 fe80::6c2e:9758:e841:ea2e  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:12:a4:0b  txqueuelen 1000  (Ethernet)
        RX packets 393949  bytes 472644074 (450.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 225066  bytes 29569818 (28.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
używany jest interfejs eth0, wlan0 jets używany do łączenia się po wifi z routerem LTE (taki patent)

przy próbie startu dhcp (systemctl isc-dhcp-server start) pojawia się błąd:

Jun 19 09:41:43 CORE systemd[1]: Starting LSB: DHCP server...
Jun 19 09:41:43 CORE isc-dhcp-server[2388]: Launching IPv4 server only.
Jun 19 09:41:43 CORE dhcpd[2394]: Internet Systems Consortium DHCP Server 4.4.1
Jun 19 09:41:43 CORE dhcpd[2394]: Copyright 2004-2018 Internet Systems Consortium.
Jun 19 09:41:43 CORE dhcpd[2394]: All rights reserved.
Jun 19 09:41:43 CORE dhcpd[2394]: For info, please visit https://www.isc.org/software/dhcp/
Jun 19 09:41:43 CORE isc-dhcp-server[2388]: Starting ISC DHCPv4 server: dhcpddhcpd service already running (pid file /var/run/dhcpd.p
Jun 19 09:41:43 CORE systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 19 09:41:43 CORE systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jun 19 09:41:43 CORE systemd[1]: Failed to start LSB: DHCP server.

---
mam takie pytanie - od czego ja powinienem zacząć poszukiwania ? Pytanie gdzie on loguje błędy z serwera dhcp ?

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 09:50
autor: LordRuthwen
A próbowałeś zrobić nie start a restart? bo tam jest napisane wprost, że dhcpd już działa.

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 10:33
autor: dominbdg
to nic nie daje, gdzieś mam błąd w tej konfiguracji dhcpd i nie wiem gdzie znaleźć żeby mi napisał co mu nie gra, podejrzewam tutaj w /etc/default/isc-dhcp-server ipv6 nie wiem jak mu wyłączyć samo ipv6

jak mu uruchomię dhcp ręcznie to działa:
/usr/sbin/dhcpd -cf /etc/dhcp/dhcpd.conf

root@CORE:~# dhcpd -cf /etc/dhcp/dhcpd.conf
Internet Systems Consortium DHCP Server 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 14 leases to leases file.

No subnet declaration for wlan0 (192.168.8.102).
** Ignoring requests on wlan0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface wlan0 is attached. **

Listening on LPF/eth0/dc:a6:32:12:a4:0a/10.10.0.0/25
Sending on LPF/eth0/dc:a6:32:12:a4:0a/10.10.0.0/25
Sending on Socket/fallback/fallback-net

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 10:34
autor: LordRuthwen
Log powinien być w /var/log/messages

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 10:36
autor: dominbdg
LordRuthwen pisze: 19 czerwca 2020, 10:34 Log powinien być w /var/log/messages
no właśnie nic mi nie pokazuje:
Jun 19 10:36:04 CORE dhcpd[4669]: Internet Systems Consortium DHCP Server 4.4.1
Jun 19 10:36:04 CORE dhcpd[4669]: Copyright 2004-2018 Internet Systems Consortium.
Jun 19 10:36:04 CORE dhcpd[4669]: All rights reserved.
Jun 19 10:36:04 CORE dhcpd[4669]: For info, please visit https://www.isc.org/software/dhcp/

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 11:32
autor: lizard
Zatrzymaj usługę i sprawdź, czy plik /var/run/dhcpd.pid wciąż istnieje. Usuń go, jeżeli tak. Następnie uruchom usługę ponownie. Jeżeli pojawi się błąd, pokaż go i plik /etc/dhcp/dhcpd.conf.

Obsługę IPv6 masz wyłączoną.

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 12:42
autor: dominbdg
to samo,

tutaj status:
root@CORE:~# systemctl status isc-dhcp-server
● isc-dhcp-server.service - LSB: DHCP server
Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
Active: failed (Result: exit-code) since Fri 2020-06-19 12:41:08 CEST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 3272 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

Jun 19 12:41:06 CORE dhcpd[3281]: bugs on either our web page at www.isc.org or in the README file
Jun 19 12:41:06 CORE dhcpd[3281]: before submitting a bug. These pages explain the proper
Jun 19 12:41:06 CORE dhcpd[3281]: process and the information we find helpful for debugging.
Jun 19 12:41:06 CORE dhcpd[3281]:
Jun 19 12:41:06 CORE dhcpd[3281]: exiting.
Jun 19 12:41:08 CORE isc-dhcp-server[3272]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Jun 19 12:41:08 CORE isc-dhcp-server[3272]: failed!
Jun 19 12:41:08 CORE systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 19 12:41:08 CORE systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jun 19 12:41:08 CORE systemd[1]: Failed to start LSB: DHCP server.

a poniżej mój konfig /etc/dhcp/dhcpd.conf:

Kod: Zaznacz cały

root@CORE:~# cat /etc/dhcp/dhcpd.conf 
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;

subnet 10.10.0.0 netmask 255.255.255.128
{
  range 10.10.0.20 10.10.0.40;
   option routers                  10.10.0.1;
   option subnet-mask              255.255.255.128;
   option domain-search            "local";
   option domain-name-servers      10.10.0.1;
   option routers                  10.10.0.1; 
   option time-offset              -18000; 
   default-lease-time 600;
   max-lease-time 7200;

}

subnet 10.11.0.0 netmask 255.255.255.192
{
  range 10.11.0.10 10.11.0.20;
   option routers                  10.10.0.1;
   option subnet-mask              255.255.255.192;
   option domain-search            "local";
   option domain-name-servers      10.10.0.1;
   option routers                  10.10.0.1; 
   option time-offset              -18000; 
   default-lease-time 600;
   max-lease-time 7200;
}

   host dominik-hp
    { hardware ethernet a0:8c:fd:26:0f:2d; 
      fixed-address 10.10.0.10; 
    }
   host epson
    { hardware ethernet 44:D2:44:52:C3:C4; 
      fixed-address 10.10.0.12; 
    }

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 12:48
autor: LordRuthwen
Edytuj /etc/rsyslog.conf poszukaj wpisu odnośnie local7. Jeśli jest, to tam szukaj logów, jeśli nie ma dodaj linię:

Kod: Zaznacz cały

local7.* /var/log/dhcpd.log
i zrób reload rsysloga.
Kolejna próba uruchomienia dhcp powinna stworzyć plik /var/log/dhcpd.log i tam będzie to czego szukasz.

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 13:15
autor: dominbdg
dzięki, bardzo się przydadzą osobne od dhcpd,
ale ja tam nic nie widzę nie wiem czemu nie chce chodzić

Jun 19 13:14:02 CORE dhcpd[5396]: Internet Systems Consortium DHCP Server 4.4.1
Jun 19 13:14:02 CORE dhcpd[5396]: Copyright 2004-2018 Internet Systems Consortium.
Jun 19 13:14:02 CORE dhcpd[5396]: All rights reserved.
Jun 19 13:14:02 CORE dhcpd[5396]: For info, please visit https://www.isc.org/software/dhcp/
Jun 19 13:14:02 CORE dhcpd[5399]: Internet Systems Consortium DHCP Server 4.4.1
Jun 19 13:14:02 CORE dhcpd[5399]: Copyright 2004-2018 Internet Systems Consortium.
Jun 19 13:14:02 CORE dhcpd[5399]: All rights reserved.
Jun 19 13:14:02 CORE dhcpd[5399]: For info, please visit https://www.isc.org/software/dhcp/
Jun 19 13:14:02 CORE dhcpd[5399]: Wrote 0 deleted host decls to leases file.
Jun 19 13:14:02 CORE dhcpd[5399]: Wrote 0 new dynamic host decls to leases file.
Jun 19 13:14:02 CORE dhcpd[5399]: Wrote 16 leases to leases file.
Jun 19 13:14:02 CORE dhcpd[5399]:
Jun 19 13:14:02 CORE dhcpd[5399]: No subnet declaration for wlan0 (192.168.8.102).
Jun 19 13:14:02 CORE dhcpd[5399]: ** Ignoring requests on wlan0. If this is not what
Jun 19 13:14:02 CORE dhcpd[5399]: you want, please write a subnet declaration
Jun 19 13:14:02 CORE dhcpd[5399]: in your dhcpd.conf file for the network segment
Jun 19 13:14:02 CORE dhcpd[5399]: to which interface wlan0 is attached. **
Jun 19 13:14:02 CORE dhcpd[5399]:
Jun 19 13:14:02 CORE dhcpd[5399]: Server starting service.
Jun 19 13:14:11 CORE dhcpd[5399]: DHCPREQUEST for 10.10.0.10 from a0:8c:fd:26:0f:2d via eth0
Jun 19 13:14:12 CORE dhcpd[5399]: DHCPACK on 10.10.0.10 to a0:8c:fd:26:0f:2d via eth0

Re: Debian 10.3 problem z serwerem dhcp

: 19 czerwca 2020, 13:22
autor: dominbdg
tutaj w logach widzę że nie ma skonfigurowanego interfejsu ale to nie jest prawda

Jun 19 13:21:04 CORE dhcpd[5645]: in your dhcpd.conf file for the network segment
Jun 19 13:21:04 CORE dhcpd[5645]: to which interface eth0 is attached. **
Jun 19 13:21:04 CORE dhcpd[5645]:
Jun 19 13:21:04 CORE dhcpd[5645]:
Jun 19 13:21:04 CORE dhcpd[5645]: Not configured to listen on any interfaces!
Jun 19 13:21:04 CORE dhcpd[5645]:
Jun 19 13:21:04 CORE dhcpd[5645]: If you think you have received this message due to a bug rather
Jun 19 13:21:04 CORE dhcpd[5645]: than a configuration issue please read the section on submitting
Jun 19 13:21:04 CORE dhcpd[5645]: bugs on either our web page at www.isc.org or in the README file
Jun 19 13:21:04 CORE dhcpd[5645]: before submitting a bug. These pages explain the proper
Jun 19 13:21:04 CORE dhcpd[5645]: process and the information we find helpful for debugging.
Jun 19 13:21:04 CORE dhcpd[5645]:
Jun 19 13:21:04 CORE dhcpd[5645]: exiting.
Jun 19 13:21:06 CORE isc-dhcp-server[5630]: Starting ISC DHCPv6 server: dhcpd6check syslog for diagnostics. ... failed!
Jun 19 13:21:06 CORE isc-dhcp-server[5630]: failed!
Jun 19 13:21:06 CORE systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE