Getting an IP from an ipv6 dhcp server

42,392

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:
42,392
Seoman
Author by

Seoman

Updated on September 18, 2022

Comments

  • Seoman
    Seoman over 1 year

    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.

    • Sander Steffann
      Sander Steffann almost 11 years
      Note: Please stop using 6bone addresses (those starting with 3ffe:). The 6bone got decommissioned in 2006.
    • Michael Hampton
      Michael Hampton almost 11 years
      Also, 6bone addresses are null routed by default. So you can't use then at all. Use a valid IPv6 prefix.
  • Seoman
    Seoman almost 11 years
    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?
  • Sander Steffann
    Sander Steffann almost 11 years
    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.