Sabtu, 06 Agustus 2022

Konfigurasi IP Address

 


Untuk langkah – langkah konfigurasi nya sebagai berikut :

  • Login ke sistem operasi debian 11 untuk melakukan konfigurasi Jaringan
  • Ikuti langkah – langkah pada script di bawah :

1. Melakukan pengecekan interfaces dengan perintah ip addr

root@akhmadfajar:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 08:00:27:7a:06:63 brd ff:ff:ff:ff:ff:ff
root@akhmadfajar:~#

2. Mengkonfigurasi IP Address menggunakan perintah nano /etc/network/interfaces

root@akhmadfajar:~# nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet static
        address 172.16.10.2
        netmask 255.255.0.0
        network 172.16.0.0
        broadcast 172.16.255.255
        gateway 172.16.10.1
        dns-nameservers 172.16.10.2

# Keluar dan menyimpan konfigurasi dengan cara menenekan CTRL+X lalu tekan y lalu Enter

3. Restart konfigurasi networking dengan cara mengetikan perintah service networking restart  lalu cek kembali konfigurasi IP dengan mengetikan perintah ip addr.

root@akhmadfajar:~# service networking restart
root@akhmadfajar:~#ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:7a:06:63 brd ff:ff:ff:ff:ff:ff
     inet 172.16.10.2/16 brd 172.16.255.255 scope global enp0s3
       valid_lft forever preferred_lft forever
root@akhmadfajar:~#