Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following lab:

DHCP SERVER [Centos 6]

/etc/dhcp/dhcpd6.conf

default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
allow leasequery;
option dhcp6.info-refresh-time 21600;


dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases";

subnet6 3ffe:501:ffff:100::/64 {
}

host ipv6host {
    hardware ethernet 53:54:00:70:1d:ed;
    fixed-address6 3ffe:501:ffff:100::222;
    if packet(0,1) = 1 { log(debug,"Request match!"); }
}

# ip -6 addr show
5: eth1.30@if3: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500
    inet6 3ffe:501:ffff:100::4/64 scope global 
       valid_lft forever preferred_lft forever

In the client there is no special configuration. Then, running the dhcp server, I get the following output:

Internet Systems Consortium DHCP Server 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in         the config file
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
Bound to *:547
Listening on Socket/5/eth1.30/3ffe:501:ffff:100::/64
Sending on   Socket/5/eth1.30/3ffe:501:ffff:100::/64

Solicit message from fe80::5054:ff:fe70:1ded port 546, transaction ID 0xDF54D000
Request match!
Request match!
Sending Advertise to fe80::5054:ff:fe70:1ded port 546
Solicit message from fe80::5054:ff:fe70:1ded port 546, transaction ID 0xDF54D000
Request match!
Request match!
Sending Advertise to fe80::5054:ff:fe70:1ded port 546
... and more

On the client, I get the following out running the client:

dhclient -6 -d  eth1
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Bound to *:546
Listening on Socket/eth1
Sending on   Socket/eth1
PRC: Soliciting for leases (INIT).
XMT: Forming Solicit, 0 ms elapsed.
XMT:  X-- IA_NA 00:70:1d:ed
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Solicit on eth1, interval 1010ms.
XMT: Forming Solicit, 1010 ms elapsed.
XMT:  X-- IA_NA 00:70:1d:ed
XMT:  | X-- Request renew in  +3600
XMT:  | X-- Request rebind in +5400
XMT: Solicit on eth1, interval 2070ms.    

As you can see, seems that server gets the request from the client and matches the host entry. that I don't know is why the client does not get the IP.

Note: the client is a vm and in the hypervisor the vnic is connected to a bridge with the eth1.30. The traffic it's ok between the nodes.

share|improve this question
1  
Note: Please stop using 6bone addresses (those starting with 3ffe:). The 6bone got decommissioned in 2006. –  Sander Steffann Jun 6 '13 at 17:28
    
Also, 6bone addresses are null routed by default. So you can't use then at all. Use a valid IPv6 prefix. –  Michael Hampton Jun 6 '13 at 19:26
add comment

2 Answers

up vote 1 down vote accepted

Solved!

The problem was the ip6tables. The default rules block the Advertise from the DHCP Server.

service ip6tables stop

Would fix the issue. Take a look on the comments of the other answers because seems that the range I used are not ok.

IMPORTANT. At least with 2 Centos 6 boxes (server and client) assigning the ip using MAC address works fine.

source: http://www.redhat.com/archives/anaconda-devel-list/2010-November/msg00172.html

share|improve this answer
add comment

In DHCPv6 the clients aren't identified anymore with their MAC address but with a DUID (which is the same for all interfaces of the client, so in theory it is easier to identify the client). Because of this you also should put the host definition inside the subnet block. The system might have different addresses based on the interface and DUID combination. This is the example from the Linux IPv6 how-to:

default-lease-time 600;
max-lease-time 7200; 
log-facility local7; 
subnet6 2001:db8:0:1::/64 {
    # Range for clients
    range6 2001:db8:0:1::129 2001:db8:0:1::254;

    # Range for clients requesting a temporary address
    range6 2001:db8:0:1::/64 temporary;

    # Additional options
    option dhcp6.name-servers 2001:4860:4860::8888;
    option dhcp6.domain-search "domain.example";

    # Prefix range for delegation to sub-routers
    prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56;

    # Example for a fixed host address
    host specialclient {
        host-identifier option dhcp6.client-id 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45;
        fixed-address6 2001:db8:0:1::127;
    } 
}

You can get the DUID of a client from the server logs, or you can extract it from the client. This is an example to parse the file that dhcp6c creates to store the generated DUID:

hexdump -e '"%07.7_ax " 1/2 "%04x" " " 14/1 "%02x:" "\n"' /var/lib/dhcpv6/dhcp6c_duid

All examples are based on those from the how-to.

share|improve this answer
    
Thinking on a cloud/virtualized env, how can I assign an ip to a host if the DUID depends of the vm and I can't know that until the vm booted? –  Seoman Jun 6 '13 at 20:35
    
Seoman: you basically can't if you follow the specs. The DUID is generated the first time it is needed, so it might not even exist until you boot for the first time. –  Sander Steffann Jun 6 '13 at 23:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.