0

I have 2 bridges (vmbr1 vmbr2) on proxmox server.

vmbr1 IP: 192.168.106.1 for NAT clients

vmbr2 IP: 192.168.107.1 for Local only

I have set up DHCP server (isc-dhcp-server) and it works perfectly with one network segment (on vmbr1).

When I attempt to set the second segment (vmbr2), DHCP server fails with the message:

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. ** 

for this error this statement apparently should fix the issue:

subnet-mask 255.255.255.0; 

However then the error becomes this:

 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. 

Here is the working /etc/default/isc-dhcp-server:

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

Here is the working /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; #} 

The options causing issue are commented out.

Any ideas?

1 Answer 1

0

No, it's not asking you to add a line

subnet-mask 255.255.255.0; 

There is no such directive as subnet-mask. What you were thinking was probably option subnet-mask; however, it's not required because the mask is already specified in the subnet declaration (i.e. the subnet x.x.x.x netmask y.y.y.y { ... } block).

The No subnet declaration for vmbr2 means that dhcpd wants to see a subnet ... { ... } block with a network address and mask that match the settings vmbr2 is currently configured to.

Here's a corrected version of your working dhcpd.conf ready to serve two subnets:

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; } 

You are apparently viewing the error messages through the systemctl status isc-dhcp-server.service output. You should be aware that it shows only the last 10 lines of the actual output. A much better way to verify the correct syntax of your DHCP server configuration would be to use the -t option of dhcpd.

When I saved your original "working /etc/dhcp/dhcpd.conf" as /tmp/dhcpd.conf.test, uncommented the first subnet-mask line and ran dhcpd -cf /tmp/dhcpd.conf.test -t, here is the full output:

# 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. 

Note that the verbiage at the end probably caused you to miss the important part:

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

indicating that the subnet-mask should not be used like that.

3
  • The "working" version that you suggested was the first I tried, however id did not work, providing me with the first error. Later on I looked up for the solution. Commented Dec 18, 2022 at 16:36
  • Interestingly, after removing all extra lines when I run " dhcpd -cf /etc/dhcp/dhcpd.conf -t " or "dhcpd -cf /etc/dhcp/dhcpd.conf -t vmbr1 vmbr2", no errors are shown. But If I do "service isc-dhcp-server restart", the "service isc-dhcp-server status" does show the error \ Commented Dec 18, 2022 at 16:43
  • Then you'll need to run journalctl -xeu isc-dhcp-server.service to view the complete journal of that service, and if necessary, use the up-arrow key to scroll back to see if there is more than one error involved. Sometimes when an error is detected while parsing a configuration file, it throws off the parser and may cause spurious errors afterwards... and if you only check service isc-dhcp-server status = systemctl status isc-dhcp-server, you may not see all the messages produced by the service. Commented Dec 19, 2022 at 1:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.