데비안 dhcpd“eth0에 대한 서브넷 선언이 없습니다” hardware ethernet

PLoP Linux 이미지를 제공하는 Debian 6.0.3 Squeeze 시스템에서 pxe 부팅 서버를 설정하려고합니다. 튜토리얼 을 따르고있었습니다 .
패키지 dhcp3-server에서 dhcpd를 시작하려고하면 다음과 같은 결과가 나타납니다.

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



Not configured to listen on any interfaces!

My /etc/dhcpd.conf는 튜토리얼 저장과 동일하며 몇 가지 변경 사항이 있습니다.

host testpc {
        hardware ethernet 00:0C:6E:A6:1A:E6;
        fixed-address 10.0.0.250;
}

대신에

host tablet {
        hardware ethernet 00:02:3F:FB:E2:6F;
        fixed-address 10.0.0.249;
}

내는 /etc/network/interfaces것입니다 :

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 10.0.0.0
        netmask 255.255.255.0

그리고 이것은 내 /etc/default/isc-dhcp-server:

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

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

어떤 사본을 복사 /etc/default/dhcp3-server했는지 확인하십시오.

또한 ip /etc/network/interfaces를 10.0.0.1 및 10.0.0.2로 설정하려고 시도했지만 동일한 결과를 얻었습니다.



답변

dhcpd는 IP 주소를 클라이언트에게 전달해야하므로 담당하는 주소 범위를 알아야합니다. 서브넷 선언은 dhcpd에 해당 정보 등을 제공합니다. 10.0.0 / 24를 사용한다고 가정하면 다음과 같이 오류 메시지를 시작하고지나 쳐야하지만 더 나아가 려면 문서 로 들어가야합니다. 이것을 dhcpd.conf에 추가하십시오 :

subnet 10.0.0.0 netmask 255.255.255.0 {
   authoritative;
   range 10.0.0.1 10.0.0.254;
   default-lease-time 3600;
   max-lease-time 3600;
   option subnet-mask 255.255.255.0;
   option broadcast-address 10.0.0.255;
   option routers 10.0.0.0;
   option domain-name-servers 8.8.8.8;
   option domain-name "example.com";
}

위에 연결 한 IP 주소는 추측입니다. 설정에 맞게 올바르게 설정해야합니다.


답변

문제는 10.0.0.0유효한 IPv4 주소가 아니라는 것입니다. 서브넷의 첫 번째 주소 (호스트 부분에 모두 0이있는 주소)는 서브넷 식별자이므로 유효한 호스트 주소가 아닙니다. 시도하십시오 10.0.0.1. IP 브로드 캐스트 주소이므로 서브넷의 마지막 주소도 피해야합니다.

Decimal:
  Address:     10   .0  .0  .0
  Subnet Mask: 255.255.255.255
Hex:
  Address:     0A 00 00 00
  Subnet Mask: FF FF FF 00
  Network:     ^^ ^^ ^^
  Host:                 ^^
  Smallest Addr:        01 (.1)
  Largest Addr:         FE (.254)
  Broadcast:            FF (.255)


답변

dhcp3-server를 제거하고 대신 dnsmasq를 사용했습니다. 구성 파일을 살펴보고 필요한 방법으로 서버를 구성하기 위해 주석이 달린 예제를 사용할 수있었습니다. dnsmasq에는 PXE 부팅에 사용한 내장 tftp 서버도 있습니다.


답변

확인

ifconfig eth0

인터페이스 eth0에 올바른 ipv4가있는 경우

(당신이 그것을 설정 한 것 같습니다 address 10.0.0.0 어쨌든 유효하지 않은 )

IP의 범위가 잘못된 경우 다음과 같이 새 주소를 지정하십시오.

ifconfig eth0 10.0.0.1

그런 다음 DHCP 서버를 다시 시작하십시오.


답변

dnsmasq를 제거하면 내 문제가 해결되었습니다.

sudo apt-get -y remove dnsmasq


답변

시스템 기반 OS에서 NetworkManager-wait-online.service가 실행 중인지 확인하십시오.

Fedora 26에서도 비슷한 문제가 있었으며 참조를 찾을 수 없으므로 누군가가 필요로하는 경우 여기에 솔루션을 게시 할 것입니다.

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

Fedora 26은 시스템 기반 OS로, 전통적인 init 스크립트 (/etc/rc.d/init.d)가 기본 시스템 서비스 파일로 대체되었습니다.

내 dhcpd.service 파일 :

[Unit]
Description=DHCPv4 Server Daemon
Documentation=man:dhcpd(8) man:dhcpd.conf(5)
Wants=network-online.target
After=network-online.target
After=time-sync.target

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/dhcpd
ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid $DHCPDARGS
StandardError=null

[Install]
WantedBy=multi-user.target

이 줄 :

Wants=network-online.target
After=network-online.target

네트워크가 온라인 상태 인 후 서비스가 시작되지만 올바른 “대기”서비스도 활성화해야합니다. 1 : NetworkManager-wait-online.service

내 것이 아니었다.

참조 :
https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/


답변