Problem to set up DHCP for ipv6 - subnet_number():inet.c:45: Addr/mask length mismatch

Reed Xia huaqin2005 at gmail.com
Fri May 27 07:31:25 UTC 2016


Hi Graham,

Thanks for helping look into my problem!

You remind me that dhcpd only refer to the file /etc/dhcpd.conf, while
dhcpd6.conf was not used actually.

After trying for times, I think I may resolve this problem in a weird way..

1. Write the following texts to /etc/dhcpd.conf

ddns-update-style none;
> subnet6 2001::/64 {
>   range6 2001::10 2001::20;
>   option dhcp6.name-servers 2001::6;
>   option dhcp6.domain-search "test.example.com";
>   default-lease-time 320;
>   max-lease-time 720;
> }
> #next-server 2001::3;


2. Cd to /etc, and execute the following:

/root/dhcp-4.3.4/srver/dhcpd* -6* -cf dhcpd.conf eth0

And will have logs:

Internet Systems Consortium DHCP Server 4.3.4
> Copyright 2004-2016 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
> Config file: /etc/dhcpd.conf
> Database file: /var/db/dhcpd6.leases
> PID file: /var/run/dhcpd6.pid
> Wrote 0 NA, 0 TA, 0 PD leases to lease file.
> Bound to *:547
> Listening on Socket/5/eth0/2001::/64
> Sending on   Socket/5/eth0/2001::/64
> No subnet6 declaration for dhcp.conf (no IPv6 addresses).
> ** Ignoring requests on dhcp.conf.  If this is not what
>    you want, please write a subnet6 declaration
>    in your dhcpd.conf file for the network segment
>    to which interface dhcp.conf is attached. **
>
> No subnet6 declaration for –cf (no IPv6 addresses).
> ** Ignoring requests on –cf.  If this is not what
>    you want, please write a subnet6 declaration
>    in your dhcpd.conf file for the network segment
>    to which interface –cf is attached. **


3. Replace /etc/dhcpd.conf with the following content:

ddns-update-style none;
> subnet 192.168.6.0 netmask 255.255.255.0 {
>   range 192.168.6.10 192.168.6.20;
>   option domain-name-servers 192.168.6.6;
>   option broadcast-address 192.168.6.255;
>   option routers 192.168.6.1;
>   default-lease-time 320;
>   max-lease-time 720;
>   option domain-name "test_redhat.com";
> }
> next-server 192.168.6.3;


4. cd to /etc and execute the following

/root/dhcp-4.3.4/server/dhcpd -cf dhcpd.conf eth0

5. Will have logs:

Internet Systems Consortium DHCP Server 4.3.4
> Copyright 2004-2016 Internet Systems Consortium.
> All rights reserved.
> For info, please visit https://www.isc.org/software/dhcp/
> Config file: dhcpd.conf
> Database file: /var/db/dhcpd.leases
> PID file: /var/run/dhcpd.pid
> Wrote 1 leases to leases file.
> Listening on LPF/eth0/8c:89:a5:ba:66:0a/192.168.6.0/24
> Sending on   LPF/eth0/8c:89:a5:ba:66:0a/192.168.6.0/24
> Sending on   Socket/fallback/fallback-net


My ubuntu with this DHCP is connected to a homeware device, I checked the
device's console and can see it works, it get both of IPv4 address and IPv6.

On Thu, May 26, 2016 at 9:00 PM, Graham Clinch <g.clinch at lancaster.ac.uk>
wrote:

> Hi Reed,
>
> There seems to be some copy-paste confusion here with the various file
> names and command lines.
>
> For IPv4
> > root at johw-Lenovo:/etc#/root/dhcp-4.3.4/server/dhcpd -cf dhcpd.conf eth0
> start
> [...]
> > Config file: dhcpd.conf
> [...]
> > *file content of dhcpd.conf*
>
>
> but for IPv6:
> > root at johw-Lenovo:/etc#/root/dhcp-4.3.4/server/dhcpd -6 -cf dhcp6.conf
> eth0 start
> [...]
> > Config file: /etc/dhcpd.conf
> [...]
> > *file content of dhcpd6.conf*
>
> So for IPv4, your command line is to read from 'dhcpd.conf', and dhcpd
> outputs that it's reading from that path, and then you report the content
> of (presumably) that file.
>
> But for IPv6, you command line is to read from 'dhcp6.conf', dhcpd outputs
> that it's reading from /etc/dhcpd.conf (a different path - the default one
> compiled into the dhcpd binary?), and you report the content of a file
> named 'dhcpd6.conf' (note additional d).
>
> I suggest you start by rechecking all the file names and command lines,
> since dhcpd is definitely not opening a file with a '6' in the name.
>
> Graham
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>



-- 
Thanks,
- Reed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20160527/ca773540/attachment.html>


More information about the dhcp-users mailing list