Jumat, 15/11/2024 - 14:45 WIB
IndonesianArabicEnglishRussianGermanFrenchChinese (Simplified)JapaneseMalayHindi

TERBARU

TEKNOLOGITUTORIAL

Steps How to Configure a Static IP Address on Ubuntu 20.04 Operating System

image_pdfimage_print

It is a good idea to set a static or fixed ip address to a server so that you can guarantee that the machine will always have the same ip address to make it easier to connect to.

ADVERTISEMENTS
Kartu ATM di Rumah, Action Mobile di Tangan

We prefer to set a static ip dynamically using my dhcp server but if you prefer to add a static IP address then this can easily be done using the following process:

ADVERTISEMENTS
Bank Aceh Syariah Mengucapkan Selamat Hari Pahlawan 10 November 2024

Set a static IP address:

Find the correct interface name:

Open a terminal and run the following command:

ADVERTISEMENTS
Memperingati 96 Tahun Sumpah Pemuda dari Bank Aceh Syariah
ip a

 

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

ADVERTISEMENTS
Selamat & Sukses atas Pelantikan Ketua DPRA, Wakil Ketua I DPRA dan Wakil Ketua II DPRA

In the example above the network card is eth0 as it is the only interface with an ip address.

ADVERTISEMENTS
Pertemuan Tahunan Perbankan Syariah 2024

Backup the networking file

It is a good idea to back up the networking file before you make any changes so that it can be quickly reverted if things go wrong. Run the following command to make a backup copy of the file:

Berita Lainnya:
Kenapa Tubidy Lebih Fleksibel Dibanding Platform Download Lain?
ADVERTISEMENTS
Selamat Memperingati Hari Santri Nasional
sudo cp /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml.bak

This will create a file called 00-installer-config.yaml.bak in the /etc/netplan/ folder in case you need it.

Edit the 00-installer-config.yaml file to set the static IP Address

Edit the 00-installer-config.yaml file in your desired editor

vim /etc/netplan/50-cloud-init.yaml

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

If your server is set to dhcp then you will see something like:Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

Edit the file to look something like:

Save the file.

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik fotoⒸ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

Apply the changes:

sudo netplan apply

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik fotoThe server will then be using the new address. If you were connected via ssh you will have to open a new session and connect to the NEW IP ADDRESS:

Berita Lainnya:
Terungkap, Ternyata Ini Profil Intan Srinita yang Viral di Medsos, Netizen: Oh Ini Toh Orangnya?

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

The server will now use this address every time it is rebooted from now on.

To revert the changes you just need to do the following:

Over write the edited file with the backup file:

sudo cp /etc/netplan/50-cloud-init.yaml.bak /etc/netplan/50-cloud-init.yaml

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik fotoReload netplan:

sudo netplan apply

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik fotoThe server will now be configured for dhcp and should have its old ip address again:Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

The server is now ready to install what ever software that you would like to install. For some ideas of what to install go to our Ubuntu Section of the site.


Reaksi & Komentar

وَإِذَا طَلَّقْتُمُ النِّسَاءَ فَبَلَغْنَ أَجَلَهُنَّ فَلَا تَعْضُلُوهُنَّ أَن يَنكِحْنَ أَزْوَاجَهُنَّ إِذَا تَرَاضَوْا بَيْنَهُم بِالْمَعْرُوفِ ۗ ذَٰلِكَ يُوعَظُ بِهِ مَن كَانَ مِنكُمْ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ ۗ ذَٰلِكُمْ أَزْكَىٰ لَكُمْ وَأَطْهَرُ ۗ وَاللَّهُ يَعْلَمُ وَأَنتُمْ لَا تَعْلَمُونَ البقرة [232] Listen
And when you divorce women and they have fulfilled their term, do not prevent them from remarrying their [former] husbands if they agree among themselves on an acceptable basis. That is instructed to whoever of you believes in Allah and the Last Day. That is better for you and purer, and Allah knows and you know not. Al-Baqarah ( The Cow ) [232] Listen

Berita Lainnya

Tampilkan Lainnya Loading...Tidak ditemukan berita/artikel lainnya.
IndonesianArabicEnglishRussianGermanFrenchChinese (Simplified)JapaneseMalayHindi