Seperti yang saya sebutkan di Apa yang perlu Anda ketahui tentang IPv6 , ada metode yang berbeda untuk mengonfigurasi alamat IPv6 pada mesin. Kami terutama akan berfokus pada konfigurasi alamat IPv6 pada sistem Red Hat Enterprise Linux (RHEL) 7 dan 8 dan menjelaskan secara singkat metode penetapan yang berbeda.
[Ingin mencoba Red Hat Enterprise Linux? Unduh sekarang secara gratis.]
Mengonfigurasi IPv6 pada RHEL 7 dan 8
Sistem Red Hat Enterprise Linux dikonfigurasi untuk mendapatkan alamat IPv6 secara otomatis. Ini adalah baris dalam file konfigurasi tempat keajaiban terjadi (saya menambahkan beberapa penjelasan untuk setiap baris):
[root@rhel8 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0
………
………
IPV6INIT="yes" ← Enable initialization on the interface
IPV6_AUTOCONF="yes" ← Accept Router Advertisements (RA’s)
IPV6_DEFROUTE="yes" ← The default IPv6 route is assigned to the interface
IPV6_FAILURE_FATAL="no" ← Opposite of ‘may-fail’
IPV6_ADDR_GEN_MODE="stable-privacy" ← IPv6 stable-privacy addressing s(RFC7217)
NAME="enp1s0"
………
………
Untuk informasi lebih lanjut tentang fungsi pengaturan koneksi tersebut, jalankan:
man nm-settings-ifcfg-rh
Konfigurasi otomatis alamat tanpa status (SLAAC)
Jika IPV6_AUTOCONF
variabel disetel ke yes
, maka metode SLAAC digunakan untuk mengkonfigurasi alamat IPv6 host dengan menggunakan Neighbor Discovery Protocol (NDP). Teknik yang diterapkan di sini adalah yang dijelaskan di bagian Multicast artikel sebelumnya, di mana ada pertukaran permintaan klien dan pesan iklan router ICMPv6.
Kami menggunakan istilah stateless karena tidak ada layanan untuk melacak alamat IPv6 yang telah ditetapkan ke klien. Sebaliknya, alamat IPv6 disusun dengan teknik yang disebut Extended Unique Identifier (EUI-64) di mana 16 bit ditambahkan ke alamat Media Access Control (MAC) (yang memiliki 48 bit), sehingga menciptakan alamat IPv6 yang unik secara global.
DHCPv6
Untuk menggunakan DHCPv6, berikut ini akan muncul dalam file konfigurasi:
IPV6_AUTOCONF="no"
DHCPV6C=”yes”
Jika DHCPv6
variabel disetel ke yes
, lalu klien mendapatkan alamat IP dari kumpulan DHCPv6. Layanan DHCPv6 kemudian melacak alamat IPv6 apa yang ditetapkan untuk klien apa. Di antara alamat IP, informasi lain seperti server DNS, waktu sewa, nama host, dan atribut lainnya didorong ke klien. Administrator harus mengonfigurasi kumpulan alamat IPv6 agar dapat melayani klien.
Manual
Dimungkinkan juga (tetapi tidak disarankan) untuk mengonfigurasi alamat IPv6 secara manual. Konfigurasi manual membutuhkan banyak usaha, rawan kesalahan, dan sulit untuk melacak alamat IPv6 apa yang ditetapkan untuk klien apa. Pada jaringan besar, server DHCPv6 lebih disukai untuk melakukan tugas ini.
Untuk mengonfigurasi IPv6 di Red Hat Enterprise Linux 7 dan 8 secara manual, versi Anda berikut ini perlu ditambahkan ke file konfigurasi:
[root@rhel8 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0
………
………
IPV6ADDR=2a01:1b0:5389:4::22f2
IPV6_DEFAULTGW=2a01:1b0:5389:4::22f0
………
………
Atau, Anda dapat mengonfigurasi secara manual melalui NetworkManager:
nmcli con mod enp1s0 ipv6.addresses "2a22:1d0:5222:4::22f2/64" gw6 "2a22:1d0:5222:4::22f0/64"
nmcli con mod enp1s0 ipv6.method manual
Menguji konektivitas IPv6
Untuk menguji konektivitas IPv6, kita dapat menjalankan ping6 di www.redhat.com:
ping6 -c2 www.redhat.com
PING www.redhat.com(g2a02-26f0-b200-018f-0000-0000-0000-0d44.deploy.static.akamaitechnologies.com (2a02:26f0:b200:18f::d44)) 56 data bytes
64 bytes from g2a02-26f0-b200-018f-0000-0000-0000-0d44.deploy.static.akamaitechnologies.com (2a02:26f0:b200:18f::d44): icmp_seq=1 ttl=58 time=8.43 ms
--- www.redhat.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 8.425/8.425/8.425/0.000 ms
Saat ping sedang berjalan, saya menjalankan Wireshark di latar belakang untuk melihat apa yang terjadi di balik kap mesin. Berikut adalah paket permintaan ICMPv6 (dikirim oleh saya) dan paket balasan ICMPv6 yang saya terima kembali.
Permintaan ICMPv6
No. Time Source Destination Protocol Length Info
18 3.471783469 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d 2a02:26f0:7b:28a::d44 ICMPv6 118 Echo (ping) request id=0x68d7, seq=1, hop limit=64 (reply in 24)
Frame 18: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface 0
Ethernet II, Src: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee), Dst: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff)
Destination: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff)
Address: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee)
Address: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv6 (0x86dd)
Internet Protocol Version 6, Src: 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d, Dst: 2a02:26f0:7b:28a::d44
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... .... .... 1010 0010 1001 1110 0100 = Flow Label: 0xa29e4
Payload Length: 64
Next Header: ICMPv6 (58)
Hop Limit: 64
Source: 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d
Destination: 2a02:26f0:7b:28a::d44
[Source GeoIP: NL]
[Destination GeoIP: ]
Internet Control Message Protocol v6
Type: Echo (ping) request (128)
Code: 0
Checksum: 0xdff6 [correct]
[Checksum Status: Good]
Identifier: 0x68d7
Sequence: 1
[Response In: 24]
Data (56 bytes)
balasan ICMPv6
No. Time Source Destination Protocol Length Info
24 3.607831042 2a02:26f0:7b:28a::d44 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d ICMPv6 118 Echo (ping) reply id=0x68d7, seq=1, hop limit=59 (request in 18)
Frame 24: 118 bytes on wire (944 bits), 118 bytes captured (944 bits) on interface 0
Ethernet II, Src: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff), Dst: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee)
Destination: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee)
Address: HonHaiPr_74:2a:27 (ad:bc:dd:fa:da:ee)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff)
Address: Ubiquiti_77:dd:a5 (aa:bb:cc:dd:ee:ff)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv6 (0x86dd)
Internet Protocol Version 6, Src: 2a02:26f0:7b:28a::d44, Dst: 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d
0110 .... = Version: 6
.... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT)
.... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0)
.... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0)
.... .... .... 1000 0110 0011 0011 0111 = Flow Label: 0x86337
Payload Length: 64
Next Header: ICMPv6 (58)
Hop Limit: 59
Source: 2a02:26f0:7b:28a::d44
Destination: 2a01:1b0:5389:2:ccff:cdcd:6ccd:dc0d
[Source GeoIP: ]
[Destination GeoIP: NL]
Internet Control Message Protocol v6
Type: Echo (ping) reply (129)
Code: 0
Checksum: 0xdef6 [correct]
[Checksum Status: Good]
Identifier: 0x68d7
Sequence: 1
[Response To: 18]
[Response Time: 136.048 ms]
Data (56 bytes)
Perhatikan bahwa banyak organisasi memilih untuk memblokir permintaan ping karena alasan keamanan, jadi sebaiknya coba ping ke beberapa situs saat menguji konektivitas Anda.