Tuesday, November 12, 2024
Ubuntu

Cara Setting IP static pada Ubuntu 20.04 LTS

ip

“Cara Setting IP static pada Ubuntu 20.04 LTS”

Pengantar

Berikut merupakan cara setting IP static pada ubuntu 20.04 LTS.

Cara Setting IP static pada Ubuntu 20.04 LTS

  • Pastikan settingan Cloud init sudah disable
root@hendropc:/home/hendro# cat /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
network: {config: disabled}
  • Cek device network
root@hendropc:/home/hendro# ip add show
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: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:4d:66:52 brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.82/24 brd 192.168.3.255 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe4d:6652/64 scope link
       valid_lft forever preferred_lft forever
  • Copy settingan network ori
cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.ori
  • Edit file network yaml ( pastikan posisi tiap line nya harus seperti di bawah karena yaml berpengaruh)
nano /etc/netplan/00-installer-config.yaml

network:
  ethernets:
    ens33:
       addresses: [192.168.3.82/24]
       gateway4: 192.168.3.2
       dhcp4: no
       nameservers:
          addresses: [8.8.8.8,111.67.67.67]
  version: 2
  • save dan apply
sudo netplan apply
  • Cek lagi IP nya
root@hendropc:/home/hendro# ip add show
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: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:4d:66:52 brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.82/24 brd 192.168.3.255 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe4d:6652/64 scope link
       valid_lft forever preferred_lft forever
root@hendropc:/home/hendro# ip route show
default via 192.168.3.2 dev ens33 proto static
192.168.3.0/24 dev ens33 proto kernel scope link src 192.168.3.82

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Setting IP Static Pada Ubuntu 20.04 LTS. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

(Visited 1,367 times, 1 visits today)

Similar Posts