Debian 11 2개 이상의 클라이언트 네트워크에 DHCP 설정

Debian 11 2개 이상의 클라이언트 네트워크에 DHCP 설정

Proxmox 서버에 2개의 브리지(vmbr1 vmbr2)가 있습니다.

vmbr1 IP: NAT 클라이언트용 192.168.106.1

vmbr2 IP: 192.168.107.1 로컬 전용

DHCP 서버(isc-dhcp-server)를 설정했는데 하나의 네트워크 세그먼트(vmbr1)와 완벽하게 작동합니다.

두 번째 네트워크 세그먼트(vmbr2)를 설정하려고 하면 다음 메시지와 함께 DHCP 서버가 실패합니다.

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

이 오류의 경우 다음 명령문으로 문제를 분명히 해결할 수 있습니다.

subnet-mask 255.255.255.0;

그러나 오류는 다음과 같습니다.

 isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
 If you think you have received this message due to a bug rather
 isc-dhcp-server.service: Failed with result 'exit-code'.
 than a configuration issue please read the section on submitting
 Failed to start LSB: DHCP server.
 bugs on either our web page at www.isc.org or in the README file
 before submitting a bug.  These pages explain the proper
 process and the information we find helpful for debugging.

 exiting.

이것은 작동하는 /etc/default/isc-dhcp-server입니다:

INTERFACESv4="vmbr1"
#INTERFACESv4="vmbr1 vmbr2"
#INTERFACESv6=""

이것은 작동하는 /etc/dhcp/dhcpd.conf입니다:

option domain-name "mydomain.ca";
option domain-name-servers 8.8.8.8,8.8.4.4;
  
subnet 192.168.106.0 netmask 255.255.255.0 {
range 192.168.106.20 192.168.106.150;
#subnet-mask 255.255.255.0;
option routers 192.168.106.1;
}

#subnet 192.168.107.0 netmask 255.255.255.0 {
#range 192.168.107.20 192.168.107.150;
#subnet-mask 255.255.255.0;
#option routers 192.168.107.1;
#}

문제를 일으키는 옵션은 주석 처리되었습니다.

어떤 아이디어가 있나요?

답변1

아니요, 줄을 추가하라는 메시지가 표시되지 않습니다.

subnet-mask 255.255.255.0;

그러한 지시문은 없습니다 subnet-mask. 라고 생각할 수도 있습니다 option subnet-mask. 그러나 마스크가 이미 subnet x.x.x.x netmask y.y.y.y { ... }서브넷 선언(예: 블록)에 지정되어 있으므로 이것이 필요하지 않습니다.

현재 구성된 설정과 일치하는 네트워크 주소와 마스크가 있는 블록을 본다는 것은 무엇을 의미합니까 No subnet declaration for vmbr2?dhcpdsubnet ... { ... }vmbr2

dhcpd.conf두 서브넷을 모두 제공할 준비를 위한 수정된 작업 버전은 다음과 같습니다.

option domain-name "mydomain.ca";
option domain-name-servers 8.8.8.8,8.8.4.4;
  
subnet 192.168.106.0 netmask 255.255.255.0 { # <-- subnet mask already specified here
range 192.168.106.20 192.168.106.150;
##subnet-mask 255.255.255.0;  <--- this line should be deleted
option routers 192.168.106.1;
}

subnet 192.168.107.0 netmask 255.255.255.0 { # <-- subnet mask already specified here
range 192.168.107.20 192.168.107.150;
##subnet-mask 255.255.255.0;  <--- this line should be deleted
option routers 192.168.107.1;
}

분명히 출력을 통해 오류 메시지를 보고 계십니다 systemctl status isc-dhcp-server.service. 실제 출력의 마지막 10줄만 표시된다는 점에 유의하세요. DHCP 서버 구성 구문이 올바른지 확인하는 더 좋은 방법 -tdhcpd.

원본 "작업 중인 /etc/dhcp/dhcpd.conf"를 로 저장하고 /tmp/dhcpd.conf.test첫 번째 subnet-mask줄의 주석 처리를 해제하고 실행하면 dhcpd -cf /tmp/dhcpd.conf.test -t전체 출력은 다음과 같습니다.

# dhcpd -cf /tmp/dhcpd.conf.test -t
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/
/tmp/dhcpd.conf.test line 6: semicolon expected.
subnet-mask 255.
             ^
Configuration file errors encountered -- exiting

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug.  These pages explain the proper
process and the information we find helpful for debugging.

exiting.

마지막에 나오는 문구로 인해 중요한 부분을 놓칠 수 있습니다.

/tmp/dhcpd.conf.test line 6: semicolon expected.
subnet-mask 255.
             ^
Configuration file errors encountered -- exiting

subnet-mask이런 식으로 사용하면 안 됨을 나타냅니다 .

관련 정보