IPv6 Server: ISC Dynamic Host Configuration Server (dhcpd)

From OnnoWiki
Revision as of 09:22, 20 July 2013 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

ISC DHCP mendukung IPv6 sejak versi 4.x.


Konfigurasi ISC DHCP server untuk IPv6 (dhcpd)

Sekedar catatan, saat ini, ISC DHCP server hanya dapat memberi layanan IPv4 atau IPv6, artinya jika kita ingin memberikan dua layanan sekaligus, kita harus start daemon dua kali (opsi IPv6 menggunakan “-6”) agar mendukung ke dua protokol.

Installing the DHCP server

To install the DHCP 4 server that support DHCPv6; install the isc-dhcp-server package:

sudo apt-get install isc-dhcp-server

You will then need to edit and modify the stock configuration file shipped in /etc/dhcp/dhcpd.conf.


Konfigurasi Sederhana

Setting up the DHCP server

To configure the DHCP server to start on your system, you will first need to modify the init script in /etc/init.d/isc-dhcp-server:

Change all the places where dhcpd is started to add an extra parameter -6; there should be three, you can place this new parameter just before -t is passed to dhcpd.

If you instead want a DHCP server for IPv4 and one for IPv6 to cohabit on the same system, copy the original init script to a new file; the original should not be modified, and your new copy should have the extra -6 parameter.

To configure the DHCP server; you can then modify the included config file in /etc/dhcp/dhcpd.conf. Note the following syntax changes for common keywords:

DHCP v4 keyword


DHCP v6 keyword

subnet <address/prefix>


subnet6 <address/prefix>

range <start ip> <end ip>


range6 (<start ip> <end ip> | <network/prefix>)

Consider checking man dhcpd.conf for the full syntax reference.


Buat file konfigurasi khusus /etc/dhcp/dhcpd6.conf untuk bagian IPv6 dari dhcpd. Catatan, router yang digunakan harus mempunyai interface yang di konfigurasi dengan IPv6 address dari subnet tersebut.

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;
        # Additional options
        option dhcp6.name-servers fec0:0:0:1::1;
        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;
    	} 
} 

Catatan bahwa “dhcp.client-id” tidak lagi berupa MAC address, sebuah ID yang unik yang akan digunakan! “dhcp6c” menggunakan file /var/lib/dhcpv6/dhcp6c_duid (akan dibuat saat pertama kali start, jika tidak ada) sebagai identitas yang unik. Ini merupakan identifier sepanjang 14 byte , berawal dengan 2 byte informasi (biasanya “0x000e”):

# hexdump -e '"%07.7_ax " 1/2 "%04x" " " 14/1 "%02x:" "\n"' /var/lib/dhcpv6/dhcp6c_duid 0000000 000e 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45:

Penggunaan

dhcpd

Start server di foreground:

# /usr/sbin/dhcpd -6 -f -cf /etc/dhcp/dhcpd.conf eth1 
Internet Systems Consortium DHCP Server 4.1.0 
Copyright 2004-2008 Internet Systems Consortium. 
All rights reserved. 
For info, please visit http://www.isc.org/sw/dhcp/ 
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file 
Wrote 0 leases to leases file. 
Bound to *:547 
Listening on Socket/5/eth1/2001:db8:0:1::/64 
Sending on   Socket/5/eth1/2001:db8:0:1::/64