Difference between revisions of "IPv6 AutoConfiguration: DHCPv6 Ubuntu"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "Sumber: https://wiki.ubuntu.com/DHCPv6 DHCPv6 Introduction As of Ubuntu version 11.04 Natty Narwhal, we have moved to ISC-DHCPv4, which now supports DHCP for IPv6, both a...")
 
 
(17 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
 +
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.
  
DHCPv6
+
Disini kita menggunakan ISC DHCPv6 Server.
  
Introduction
 
  
As of Ubuntu version 11.04 Natty Narwhal, we have moved to ISC-DHCPv4, which now supports DHCP for IPv6, both as a server and as a client.
+
==Install DHCP server==
  
DHCPv6 offers advantages over "traditional" stateless IPv6 autoconfigurations: as with IPv4, you can hand out specific addresses to clients and have them keep the same address throughout their lifetime. DHCPv6 also obviously allows logging of reservations and selected addresses, which can allow system administrators to more easily identifies issues that could arise from autoconfiguration.
+
Instalasi
  
ISC DHCP v6 Server
+
sudo su
 +
apt update
 +
apt install isc-dhcp-server
  
==Installing the DHCP server==
+
File konfigurasi ada di
  
To install the DHCP 4 server that support DHCPv6; install the isc-dhcp-server package:
+
/etc/dhcp/dhcpd.conf
 +
/etc/dhcp/dhcpd6.conf
  
sudo apt-get install isc-dhcp-server
+
==Setup DHCP server==
  
You will then need to edit and modify the stock configuration file shipped in /etc/dhcp/dhcpd.conf.
+
File yang penting untuk di konfigurasi
  
==Setting up the DHCP server==
+
/etc/init.d/isc-dhcp-server
 +
/etc/dhcp/dhcpd.conf
  
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:
+
Contoh untuk IPv6 ada di
  
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.
+
/etc/dhcp/dhcpd6.conf
  
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.
+
Satu ISC DHCP server hanya bisa mengoperasikan salah satu dari IPv4 atau IPv6, tidak bisa sekaligus. Untuk bisa memberikan sekaligus IPv4 dan IPv6 address, kita perlu menjalan DUA (2) instance DHCPD. Pastikan interface di set dengan IP address yang benar, misalnya,
  
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:
+
ifconfig enp0s3 10.10.10.1 netmask 255.255.255.0
 +
ip address add 2345::1/64 dev enp0s3
  
DHCP v4 keyword
+
Untuk alokasi IPv6 yang perlu kita perhatikan saat mengkonfigurasi /etc/dhcp/dhcpd6.conf.
DHCP v6 keyword
 
  
subnet <address/prefix>
+
Contoh untuk IPv4, edit /etc/dhcp/dhcpd4.conf
subnet6 <address/prefix>
 
  
range <start ip> <end ip>
+
default-lease-time 600;
range6 (<start ip> <end ip> | <network/prefix>)
+
max-lease-time 7200;
 +
subnet 10.10.10.0 netmask 255.255.255.0 {
 +
        range 10.10.10.10 10.10.10.20;
 +
}
  
Consider checking man dhcpd.conf for the full syntax reference.
+
Contoh untuk IPv6, edit /etc/dhcp/dhcpd6.conf
  
==ISC DHCP v6 Client==
+
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.
  
Installing the DHCP client
+
==Run==
  
On most systems, the ISC DHCP client should already be installed. This is true for both standard desktop and server installs.
+
chmod 777 /var/lib/dhcp/
 +
chown nobody: /var/lib/dhcp/
  
The ISC DHCP client can be installed with the following command:
+
Run DUA (2) instance.
  
  sudo apt-get install isc-dhcp-client
+
  dhcpd -4 -cf /etc/dhcp/dhcpd4.conf
 +
dhcpd -6 -cf /etc/dhcp/dhcpd6.conf
  
You can then use the dhcp client by issuing the following command:
+
Mematikan
  
  sudo dhclient <iface>
+
  killall dhcpd
  
Where <iface> is the network device you want to configure. For example, eth0, or wlan0.
+
==ISC DHCP v6 Client==
  
==Client configuration==
+
Pada umumnya DHCP Client sudah di install tidak perlu di install lagi. Tapi kalau terpaksa menginstalasi dhcp client, kita dapat menggunakan perintah,
  
ISC DHCP 4 provides much of the same configuration files and parameters as DHCP 3.
+
sudo su
 +
apt update
 +
apt install isc-dhcp-client
  
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.
+
Untuk memaksa / memperoleh IP address dari server dapat menggunakan perintah,
  
From man dhclient.conf:
+
sudo dhclient <iface>
  
      The client does not yet have a default DHCPv6 Option Request Option (ORO), nor
+
Dimana <iface> adalah nama network device yang kita gunakan, bisa eth0, eth1, wlan0 dll.
      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;
+
==Client configuration==
  
      The  above ORO will request both identifiers (server, client), the preference,
+
ISC DHCP 4 menggunakan parameter konfigurasi yang sama dengan DHCP 3.
      unicast, nameservers, domain-search, and FQDN(v6) options.
 
  
 +
File konfigurasi yang digunakan oleh dhclient /etc/dhcp/dhclient.conf. Sebagian besar parameter konfigurasi yang digunakan sama dengan DHCP3 dan /etc/dhcp3/dhclient.conf; mohon melihat man dhclient.conf.
  
 +
Dari 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==
 
==Referensi==

Latest revision as of 05:38, 4 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

Satu ISC DHCP server hanya bisa mengoperasikan salah satu dari IPv4 atau IPv6, tidak bisa sekaligus. Untuk bisa memberikan sekaligus IPv4 dan IPv6 address, kita perlu menjalan DUA (2) instance DHCPD. 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 DUA (2) instance.

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 menggunakan parameter konfigurasi yang sama dengan DHCP 3.

File konfigurasi yang digunakan oleh dhclient /etc/dhcp/dhclient.conf. Sebagian besar parameter konfigurasi yang digunakan sama dengan DHCP3 dan /etc/dhcp3/dhclient.conf; mohon melihat man dhclient.conf.

Dari 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