2

I have a ubuntu 14.04 LTS machine created in VirtualBox which I could configure IPv4 delegation via isc-dhcp-server. Then by follow this great tutorial, I could configure such machine to also update the IPv4 DNS zone with the hostname and IPv4 of the new machine connected to this network.

I'm trying to do something similar but for IPv6. I already can assign IPv6 address to new machines into the network but the respective zones aren't getting updated with such hostnames.

Is there any guidance or tutorial I could follow to make such config correctly? I've been researching for days but couldn't find anything a a little bit straightforward on Internet.

1 Answer 1

1

I found a few sites from which I combined information to try to solve the same problem: https://blog.marquis.co/configuring-a-dual-stacked-dhcp-server/

https://subatomicsolutions.org/8-freebsd/17-ipv4-ipv6-isc-dhcp-server-on-a-dual-stack-network

https://blog.netpro.be/dhcpv6-configuration-isc-dhcp-server/

Also I did this on Ubuntu 20.04, where I was running only DHCPv4.

  1. Copy /etc/init.d/isc-dhcp-server to /etc/init.d/isc-dhcp-server6.

  2. Copy /etc/default/isc-dhcp-server to /etc/default/isc-dhcp-server6.

    • In /etc/default/isc-dhcp-server, uncomment the DHCPDv4_CONF and DHCPDv4_PID lines and leave OPTIONS blank. Add your IPv4 interface to INTERFACESv4.
    • In /etc/default/isc-dhcp-server6, uncomment the DHCPDv6_CONF and DHCPDv6_PID lines and add "-6" to OPTIONS. Add your IPv6 interface to INTERFACESv6.
  3. I added or removed dynamic DNS options to my existing /etc/dhcp/dhcpd.conf file:

    #ddns-update-style standard; # removed for dual stack
    dns-update-style interim; # added for dual stack
    ddns-dual-stack-mixed-mode true; # added for dual stack
    update-conflict-detection true; # added for dual stack
    update-optimization true; # added for dual stack
    allow client-updates; # added for dual stack
    ddns-domainname "exampledomain.local"; # added for dual stack
    
  4. Here is an example /etc/dhcp/dhcpd6.conf file:

    # Server configuration file example for DHCPv6
    # Global options
    option domain-name "exampledomain.local";
    # Global definitions for name server address(es)
    option dhcp6.name-servers fde3:abcd:1234:5678::30;
    # IPv6 address valid lifetime
    #  (at the end the address is no longer usable by the client)
    #  (set to 30 days, the usual IPv6 default)
    # changed to 1/2 hour for testing
    default-lease-time 1800;
    # IPv6 address preferred lifetime
    #  (at the end the address is deprecated, i.e., the client should use
    #   other addresses for new connections)
    #  (set to 7 days, the  usual IPv6 default)
    preferred-lifetime 450;
    # T1, the delay before Renew
    #  (default is 1/2 preferred lifetime)
    #  (set to 1 hour)
    option dhcp-renewal-time 225;
    # T2, the delay before Rebind (if Renews failed)
    #  (default is 3/4 preferred lifetime)
    #  (set to 2 hours)
    option dhcp-rebinding-time 335;
    # Enable RFC 5007 support (same than for DHCPv4)
    allow leasequery;
    # Set preference to 255 (maximum) in order to avoid waiting for
    # additional servers when there is only one
    option dhcp6.preference 255;
    # The delay before information-request refresh
    #  (minimum is 10 minutes, maximum one day, default is to not refresh)
    #  (set to 6 hours)
    option dhcp6.info-refresh-time 3600;
    #DDNS config
    ddns-update-style standard;
    ddns-dual-stack-mixed-mode true;
    update-conflict-detection true;
    ddns-domainname "exampledomain.local";
    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    authoritative;
    # keys so DHCP can dynamicaly update dns
    include "/etc/dhcp/rndc-keys/rndc.key";
    # zones to dynamically update
    zone exampledomain.local. {  
      primary6 fde3:abcd:1234:5678::30;  
      key rndc-key;  
    }  
    zone 8.7.6.5.4.3.2.1.d.c.b.a.3.e.d.f.ip6.arpa. {  
      primary6 fde3:abcd:1234:5678::30;  
      key rndc-key;  
    }  
    # The subnet where the server is attached
    #  (i.e., the server has an address in this subnet)
    subnet6 fde3:abcd:1234:5678::/64 {
        range6 fde3:abcd:1234:5678::31 fde3:abcd:1234:5678::50;
        option dhcp6.name-servers fde3:abcd:1234:5678::30;
        option domain-name "exampledomain.local";
    
    }
    
  5. For the existing /etc/bind/named.conf.options, I added the IPv6 loopback and interface addresses to my acl entry, and uncommented listen-on-v6 { <ipv6 dhcp server address>; ::1; };.

  6. For the existing /etc/bind/named.conf.local, I added a reverse lookup zone for IPv6.

  7. I created the db file for the IPv6 reverse lookup zone. Also edit existing db files as needed. To avoid errors due to out of sync zones, remove .jnl files from /var/lib/bind and restart bind. (thanks to https://serverfault.com/questions/874175/unable-to-add-forward-map-servfail for that tip)

  8. After completing previous steps, when you run the sudo service --status-all command your output should include [ - ] isc-dhcp-server6. Restart DHCP (sudo systemctl restart isc-dhcp-server.service) and DNS (sudo systemctl restart bind9.service). Start DHCPv6 (sudo systemctl start isc-dhcp-server6.service).

This gave my two separate services for DHCP and DHCPv6. I'm not sure yet how well it works since I am using this to test IPv6 devices. There may be a cleaner way to do this, but I hope it helps.

I noticed ICMP port not reachable messages from IPv6 DNS queries, so I ran sudo ufw allow Bind9. Currently my DHCPv6 server is issuing leases but is not dynamically updating DNS. Also in /etc/bind/named.conf.options I had to remove specific IPv6 addresses and revert the listen-on-v6 host back to { any; }.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .