FS#23933 - [dhcp] Separate v4 and v6 configuration files

Attached to Project: Arch Linux
Opened by Andrej Podzimek (andrej) - Monday, 25 April 2011, 16:13 GMT
Last edited by Isenmann Daniel (ise) - Monday, 13 July 2015, 21:17 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Isenmann Daniel (ise)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:
DHCPv4 and DHCPv6 settings cannot coexist in one file. It would be fine to include two configuration files by default and also set the corresponding -cf option in /etc/conf.d/dhcp. (Or perhaps there are compile-time options that could select the configuration files according to the -4 or -6 option.)

Additional info:
* package version(s) dhcp 4.2.1.1-1
This task depends upon

Closed by  Isenmann Daniel (ise)
Monday, 13 July 2015, 21:17 GMT
Reason for closing:  Fixed
Additional comments about closing:  In newest package there are two conf files, one for dhcp4 (/etc/dhcpd.conf) and one for dhcp6 (/etc/dhcpd6.conf). Both files are referred in the corresponding systemd files.
Comment by Isenmann Daniel (ise) - Wednesday, 27 April 2011, 06:15 GMT
Can you give me some more information why they can't coexist in one file. The configuration file at /etc/conf.d/dhcp has only two lines which are both sourced for each server (v4 and v6). Each server takes only the line it needs.

Please give some more description, because I don't see any necessity to change this behavior at the moment.
Comment by Isenmann Daniel (ise) - Tuesday, 17 May 2011, 09:01 GMT
Any response? Otherwise I will close this bug in a week.
Comment by Andrej Podzimek (andrej) - Tuesday, 17 May 2011, 09:29 GMT
My feature request is unrelated to /etc/conf.d/dhcp. It is related to /etc/dhcpd.conf. If you combine IPv4 and IPv6 options in one dhcpd.conf file, then dhcpd will not work. (This is really easy to try...) That's why it would be fine to supply two configuration files by default, such as /etc/dhcpd{4,6}.conf. The current setup would be suitable for IPv4-only and IPv6-only scenarios. However, dual stack servers are likely to be preferred in the near future.
Comment by Isenmann Daniel (ise) - Tuesday, 13 September 2011, 06:13 GMT
I will implement this in the next package upgrade which should be come this week. The package is now flagged as outdated some time, haven't found the time yet to update it, but this week I will be able to do it and I will include your request.
Comment by Jelle van der Waa (jelly) - Wednesday, 08 August 2012, 18:50 GMT
Isn't this bug already fixed?
Comment by Malstrond (Malstrond) - Thursday, 25 April 2013, 09:15 GMT
  • Field changed: Percent Complete (100% → 0%)
I requested to reopen the bug because the problem that one configuration file cannot be used in both IPv4 and IPv6 mode is still present.

Currently, neither dhcpd4.service nor dhcpd6.service specify the -cf option. systemd does not honor /etc/conf.d/dhcp. This means in both cases there is no -cf option and dhcpd will try to use the default configuration file location, which is /etc/dhcpd.conf.

Example:


Put only the following statement in /etc/dhcpd.conf:

subnet6 2001:0000:0000:0000::/64 { }

Then run

dhcpd -4 -pf /run/dhcpd6.pid

like dhcpd4.service does. Result:

Internet Systems Consortium DHCP Server 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
unable to create icmp socket: Operation not permitted
/etc/dhcpd.conf line 17: subnet6 statement is only supported in DHCPv6 mode.
subnet6
^
Configuration file errors encountered -- exiting

Now put only the following in /etc/dhcpd.conf:

subnet 10.0.0.0 netmask 255.255.255.0 { }

Then run

dhcpd -6 -pf /run/dhcpd6.pid

like dhcpd6.service does. Result:

Internet Systems Consortium DHCP Server 4.2.5
Copyright 2004-2013 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.
subnet_number():inet.c:53: Addr/mask length mismatch.

The "Addr/mask length mismatch" results from dhcpd trying to parse 10.0.0.0 as an IPv6 adress. Report on this behavior: http://www.yaleman.org/2013/03/06/isc-dhcpd-with-ipv6-subnet_numberinet-c53-addrmask-length-mismatch/

A solution would be to include "-cf /etc/dhcpd4.conf" in dhcpd4.service and "-cf /etc/dhcpd6.conf" in dhcpd6.service.


Here someone ran into the same problem: http://www.blackcatstudios.org/content/configuring-dhcpd6-arch-linux
Comment by Andrej Podzimek (andrej) - Tuesday, 26 November 2013, 13:36 GMT
Having to edit both unit files manually on each update of the package is really somewhat cumbersome... One day we will move from the dual stack era to pure IPv6 and one file will suffice, but it won't happen today or any time soon. Two separate configuration files really do make sense, unless there's a possibility (unknown to me) to put both IPv4 and IPv6 settings into one single file.
Comment by Alice (Alice) - Wednesday, 24 June 2015, 17:23 GMT
Isn't this bug already fixed?
Comment by Isenmann Daniel (ise) - Tuesday, 07 July 2015, 07:26 GMT
Just for information: At the moment I have too little time for Arch, I will do my best to find a solution in the next upcoming weeks.

Loading...