Difference between revisions of "IPv6 AutoConfiguration: DHCPv6 Ubuntu"

From OnnoWiki
Jump to navigation Jump to search
Line 40: Line 40:
 
Contoh untuk IPv4, edit /etc/dhcp/dhcpd4.conf
 
Contoh untuk IPv4, edit /etc/dhcp/dhcpd4.conf
  
   
+
  default-lease-time 600;
 +
max-lease-time 7200;
 
  subnet 10.10.10.0 netmask 255.255.255.0 {
 
  subnet 10.10.10.0 netmask 255.255.255.0 {
 
         range 10.10.10.10 10.10.10.20;
 
         range 10.10.10.10 10.10.10.20;
Line 47: Line 48:
 
Contoh untuk IPv6, edit /etc/dhcp/dhcpd6.conf
 
Contoh untuk IPv6, edit /etc/dhcp/dhcpd6.conf
  
 +
default-lease-time 600;
 +
max-lease-time 7200;
 
  subnet6 2345::/64 {
 
  subnet6 2345::/64 {
 
         range6 2345:1000:: 2345:2000::;
 
         range6 2345:1000:: 2345:2000::;

Revision as of 11:31, 3 February 2019

Sumber: https://wiki.ubuntu.com/DHCPv6


DHCPv6 mempunyai keuntungan yang lebih di bandingkan dengan IPv6 autoconfiguration tradisional. Seperti halnya IPv4, melalui DHCP kita dapat memberikan IPv6 spesifik untuk sebuah mesin selama dia hidup. Di samping itu, DHCPv6 memungkinkan kita utuk mencatat penggunaan address tertentu sehingga memudahkan dalam mengidentifikasi masalah yang di sebabkan oleh autoconfiguration.

Disini kita menggunakan ISC DHCPv6 Server.


Install DHCP server

Instalasi

sudo su
apt update
apt install isc-dhcp-server

File konfigurasi ada di

/etc/dhcp/dhcpd.conf
/etc/dhcp/dhcpd6.conf

Setup DHCP server

File yang penting untuk di konfigurasi

/etc/init.d/isc-dhcp-server
/etc/dhcp/dhcpd.conf

Contoh untuk IPv6 ada di

/etc/dhcp/dhcpd6.conf

Tampaknya ISC DHCP server hanya bisa beroperasi salah satu dari IPv4 atau IPv6, tidak bisa sekaligus. Pastikan interface di set dengan IP address yang benar, misalnya,

ifconfig enp0s3 10.10.10.1 netmask 255.255.255.0
ip address add 2345::1/64 dev enp0s3

Untuk alokasi IPv6 yang perlu kita perhatikan saat mengkonfigurasi /etc/dhcp/dhcpd6.conf.

Contoh untuk IPv4, edit /etc/dhcp/dhcpd4.conf

default-lease-time 600;
max-lease-time 7200; 
subnet 10.10.10.0 netmask 255.255.255.0 {
        range 10.10.10.10 10.10.10.20;
}

Contoh untuk IPv6, edit /etc/dhcp/dhcpd6.conf

default-lease-time 600;
max-lease-time 7200;
subnet6 2345::/64 {
        range6 2345:1000:: 2345:2000::;
}

Perhatikan di dhcpd.conf ada tambahan "6" di subnet6 dan range6 untuk IPv6.

Run

chmod 777 /var/lib/dhcp/
chown nobody: /var/lib/dhcp/

Run

dhcpd -4 -cf /etc/dhcp/dhcpd4.conf
dhcpd -6 -cf /etc/dhcp/dhcpd6.conf

Mematikan

killall dhcpd

ISC DHCP v6 Client

Pada umumnya DHCP Client sudah di install tidak perlu di install lagi. Tapi kalau terpaksa menginstalasi dhcp client, kita dapat menggunakan perintah,

sudo su
apt update
apt install isc-dhcp-client

Untuk memaksa / memperoleh IP address dari server dapat menggunakan perintah,

sudo dhclient <iface>

Dimana <iface> adalah nama network device yang kita gunakan, bisa eth0, eth1, wlan0 dll.

Client configuration

ISC DHCP 4 provides much of the same configuration files and parameters as DHCP 3.

The configuration file used by dhclient is /etc/dhcp/dhclient.conf. Most configuration parameters are the same as in DHCP3 and /etc/dhcp3/dhclient.conf; please refer to man dhclient.conf.

From man dhclient.conf:

      The client does not yet have a default DHCPv6 Option Request Option (ORO), nor
      has it been integrated with the 'request' and 'require' syntax above.   It  is
      neccessary to configure an ORO then.
        send dhcp6.oro 1, 2, 7, 12, 13, 23, 24, 39;
      The  above ORO will request both identifiers (server, client), the preference,
      unicast, nameservers, domain-search, and FQDN(v6) options.




Referensi

Pranala Menarik