IPv6 static IP address

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

IPv6 static IP address

MAYER Hans

Dear All,

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

For IPv6 it's different. In the leases file I can find an "ia-na" string. Which is an ugly string. For the config file I need a "host-identifier option dhcp6.client-id" entry to generate a static entry. This one is called "DHCPv6 Client DUID" running Windows "ipconfig"
As far as I understand "DUID" can be generated out of the "ia-na" string. I read somewhere that the first 4 character should be stripped off and the rest is DUID. Is it ?

Is there a program/script available which can do this ?

Is there a way to identify a relation between IPv4 and IPv6 entries for the same device ?
Sometimes I can find a host name in the leases file - ok -than it's easy.

But sometimes I see only this: ( for example )

ia-na "\000\000\000\000\000\001\000\001\034\333\232\203\3300bo%\202" {
  cltt 5 2016/04/08 05:24:10;
  iaaddr 2001:db8::1 {
    binding state active;
    preferred-life 40000;
    max-life 43200;
    ends 5 2016/04/08 17:24:10;
  }
}

Or even a much smaller entry. Just this.

ia-na "\312\010\000\016\000\001\000\001\033\310\2566^\373\3119\376\030" {
  cltt 2 2016/04/05 17:41:28;
}


Kind regards
Hans



_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: IPv6 static IP address

Enno Rey
Hi Hans,

On Fri, Apr 08, 2016 at 01:00:51PM +0000, MAYER Hans wrote:
>
> Dear All,
>
> 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
>
> For IPv6 it's different. In the leases file I can find an "ia-na" string. Which is an ugly string. For the config file I need a "host-identifier option dhcp6.client-id" entry to generate a static entry.

that's correct, see also, for example,
https://www.insinuator.net/2015/02/is-rfc-6939-support-finally-here-checking-the-implementation-of-the-client-link-layer-address-option-in-dhcpv6/



 This one is called "DHCPv6 Client DUID" running Windows "ipconfig"
> As far as I understand "DUID" can be generated out of the "ia-na" string. I read somewhere that the first 4 character should be stripped off and the rest is DUID. Is it ?

that's not correct. the DUID can be generated in different ways (see RFCs 3315 and 6355) with Windows defaulting to LLT approach. but you won't need this for static assignments anyway, see the above link.

hth

Enno





>
> Is there a program/script available which can do this ?
>
> Is there a way to identify a relation between IPv4 and IPv6 entries for the same device ?
> Sometimes I can find a host name in the leases file - ok -than it's easy.
>
> But sometimes I see only this: ( for example )
>
> ia-na "\000\000\000\000\000\001\000\001\034\333\232\203\3300bo%\202" {
>   cltt 5 2016/04/08 05:24:10;
>   iaaddr 2001:db8::1 {
>     binding state active;
>     preferred-life 40000;
>     max-life 43200;
>     ends 5 2016/04/08 17:24:10;
>   }
> }
>
> Or even a much smaller entry. Just this.
>
> ia-na "\312\010\000\016\000\001\000\001\033\310\2566^\373\3119\376\030" {
>   cltt 2 2016/04/05 17:41:28;
> }
>
>
> Kind regards
> Hans
>
>
>
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users

--
Enno Rey

ERNW GmbH - Carl-Bosch-Str. 4 - 69115 Heidelberg - www.ernw.de
Tel. +49 6221 480390 - Fax 6221 419008 - Cell +49 173 6745902

Handelsregister Mannheim: HRB 337135
Geschaeftsfuehrer: Enno Rey

=======================================================
Blog: www.insinuator.net || Conference: www.troopers.de
Twitter: @Enno_Insinuator
=======================================================
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: IPv6 static IP address

Graham Clinch
In reply to this post by MAYER Hans
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
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

RE: IPv6 static IP address

MAYER Hans


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:[hidden email]]
Sent: Friday, April 8, 2016 3:42 PM
To: [hidden email]
Cc: MAYER Hans <[hidden email]>
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
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users