IPv6 AutoConfiguration: DHCPv6 Ubuntu: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
Onnowpurbo (talk | contribs)
 
(14 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.
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.
ISC DHCP v6 Server


==Install DHCP server==
==Install DHCP server==
Line 31: Line 25:


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


Contoh untuk IPv6 ada di


/etc/dhcp/dhcpd6.conf


To configure the DHCP server to start on your system, you will first need to modify the init script in :
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,


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.
ifconfig enp0s3 10.10.10.1 netmask 255.255.255.0
ip address add 2345::1/64 dev enp0s3


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.
Untuk alokasi IPv6 yang perlu kita perhatikan saat mengkonfigurasi /etc/dhcp/dhcpd6.conf.


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:
Contoh untuk IPv4, edit /etc/dhcp/dhcpd4.conf


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


subnet <address/prefix>
Contoh untuk IPv6, edit /etc/dhcp/dhcpd6.conf
subnet6 <address/prefix>


range <start ip> <end ip>
default-lease-time 600;
range6 (<start ip> <end ip> | <network/prefix>)
max-lease-time 7200;
subnet6 2345::/64 {
        range6 2345::1000 2345::2000;
}


Consider checking man dhcpd.conf for the full syntax reference.
Perhatikan di dhcpd.conf ada tambahan "6" di subnet6 dan range6 untuk IPv6.


==ISC DHCP v6 Client==
==Run==


Installing the DHCP client
chmod 777 /var/lib/dhcp/
chown nobody: /var/lib/dhcp/


On most systems, the ISC DHCP client should already be installed. This is true for both standard desktop and server installs.
Run DUA (2) instance.


The ISC DHCP client can be installed with the following command:
dhcpd -4 -cf /etc/dhcp/dhcpd4.conf
dhcpd -6 -cf /etc/dhcp/dhcpd6.conf


sudo apt-get install isc-dhcp-client
Mematikan


You can then use the dhcp client by issuing the following command:
killall dhcpd


sudo dhclient <iface>
==ISC DHCP v6 Client==


Where <iface> is the network device you want to configure. For example, eth0, or wlan0.
Pada umumnya DHCP Client sudah di install tidak perlu di install lagi. Tapi kalau terpaksa menginstalasi dhcp client, kita dapat menggunakan perintah,


==Client configuration==
sudo su
apt update
apt install isc-dhcp-client


ISC DHCP 4 provides much of the same configuration files and parameters as DHCP 3.
Untuk memaksa / memperoleh IP address dari server dapat menggunakan perintah,


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.
sudo dhclient <iface>


From man dhclient.conf:
Dimana <iface> adalah nama network device yang kita gunakan, bisa eth0, eth1, wlan0 dll.


      The client does not yet have a default DHCPv6 Option Request Option (ORO), nor
==Client configuration==
      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,
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 22:38, 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

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