UPDATE

TEKNOLOGITUTORIAL

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

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.

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:

Set a static IP address:

Find the correct interface name:

Open a terminal and run the following command:

ip a

 

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto

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

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:

Ⓒ Hak cipta foto di atas dikembalikan sesungguhnya kepada pemilik foto
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.

Berita Lainnya:
Berawal dari Gift TikTok hingga Berakhir di Kamar Hotel, Sunanto (41) Habisi Putri (18) karena Menolak Dinikahi

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

Statistic IPThe 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:
Perlukah umat Muslim memiliki jejaring sosial sendiri? Pengalaman Salam Social

Statistic IP

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

Statistic IPReload 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

Berita Lainnya

Tampilkan Lainnya Loading...Tidak ditemukan berita/artikel lainnya.