IPv6 static IP address

MAYER Hans mayer at iiasa.ac.at
Mon Apr 11 14:46:02 UTC 2016



Dear Graham, dear Enno, 

This sounds great - for the first attempt.
I downloaded 4.3.4 and compiled it with the following options:
./configure  '--localstatedir=/var' '--enable-dhcpv6' --enable-use-sockets --enable-ipv4-pktinfo

Within "dhcpd6.conf" I made an entry like this: 

 host pcxyz {
    hardware ethernet d4:be:d9:96:cc:05 ;
    fixed-address6 2001:db8:21f0:56:3::10 ;
    option dhcp6.fqdn "pcxyz.some.domain" ;
 }

"dhcpd" started without complaining about anything. I tested with Windows 7 as client.
But the client got an address out of the subnet6 -> range6 network area. And not the fixed. 

The example config in the source tree says about such an entry:

        # This host entry is hopefully matched if the client supplies a DUID-LL
        # or DUID-LLT containing this MAC address.

Obviously it isn't in my case. And I do not understand it completely. 
The DUID type is link layer address plus time (1)  - says Wireshark.

Next I tried the following instead of the entry above: 

host pcxyz {
    host-identifier option dhcp6.client-id 00:01:00:01:13:43:77:3f:00:26:b9:75:ef:a7 ;
    fixed-address6 2001:db8:21f0:56:3::10 ;
    option dhcp6.fqdn "pcxyz. some.domain" ;
 }

And this worked perfectly. 
I "wireshark'ed" in Windows. In the "Solicit XID" frame ->  "Client Identifier" this PC offers a different "Link-layer address" as the hardware MAC address is. 
I have to explain that DHCP server and client are not in  the same network. Between there is a Cisco switch/router 6506. The VLAN definition has an " ip helper-address" for IPv4 and an " ipv6 dhcp relay destination" for IPv6. And " ipv6 nd managed-config-flag",  "ipv6 nd other-config-flag"  is also available.  But I think this fact - going over a router -  isn't the issue. 

Enno, I made this great "log" entry you offered in the link. I see a lot of "dhcpd" entries the log ( in my case local7.debug ). But nothing with "Lease for".

Any ideas where I should look next ? 
Actually I do not care how the statement is defined as long as I can read the information out of the server logs/leases and I haven't to go to the PC and look for an information. 

Any help is welcome.


Kind regards
Hans

-- 



-----Original Message-----
From: Graham Clinch [mailto:g.clinch at lancaster.ac.uk] 
Sent: Friday, April 8, 2016 3:42 PM
To: dhcp-users at lists.isc.org
Cc: MAYER Hans <mayer at iiasa.ac.at>
Subject: Re: IPv6 static IP address

Hi Hans,

> We are using ISC dhcp version 4.3.3 with Cisco router and we try to implement IPv6. So far IPv4 is working well and with IPv6 it's fine with dynamic IP addresses and dynamic DNS updates are also working fine. But sometimes we want to assign static IP addresses. As well for V4 as for V6.
> With IPv4 I have done this since several years. It's easy. I can read the MAC address from the lease file and can make an entry in dhcpd.conf 

'hardware ethernet' also works for DHCPv6 (from 'Changes since 4.1.0 (new features)' in the release notes):

- The 'hardware [ethernet|etc] ...;' parameter in host records has been
  extended to attempt to match DHCPv6 clients by the last octets of a
  DUID-LL or DUID-LLT provided by the client.

And RFC 6939 support was added in 4.3.4 (from 'Changes since 4.3.3' in the release notes):

- The server will now match DHCPv6 relayed clients to host declarations
  which include the "hardware" statement, if the relay connected to the
  client supplies the client's hardware address via client-linklayer-address
  option as per RFC 6939.
  [ISC-Bugs #40334]

So if you know the hardware address from IPv4, you can add a similar host declaration for v6 without worrying about the duid (unless you want to).

Some DHCP clients can send the v6 DUID as the v4 client identifier, so rather than matching on hardware address you match both on client identifier.  This seems to have been the original intention in the specifications, but the real world doesn't seem to be working that way.

Graham


More information about the dhcp-users mailing list