In this Tutorial, we want to set IP static on ubuntu 20.04 LTS Server with netplan.
Netplan enables easily configuring networking on a system via YAML files. Netplan processes the YAML and generates the required configurations for either NetworkManager or systemd-network the system’s renderer.
Ok. Now In the following, we will consider about set IP static on ubuntu 20.04 manually.
Set IP static on Ubuntu 20.04 LTS Server with netplan
check Interface name
In first the first step, we have to check all interfaces on the ubuntu 20.04 LTS server. We Enter the below command for getting NIC name.
when you enter the command, you can see your interface name. and we need the name for network configuration later.
Set the IP address on ubuntu 20.04 server
Go to /etc/netplan directory and check the name of YAML file.
after that, you can use the ls command to see YAML file.
ok, now it’s time to set IP static on ubuntu 20.04 LTS Server.
Sudo nano 00-installer-config.yaml
Remember: please edit your yam file.
Type your Static IP and other information like this
network ethernets: ens160: dhcp4: no addresses: [192.168.100.120/24] gateway4: 192.168.100.1 nameservers: addresses: [188.8.131.52, 184.108.40.206] dhcp6: no version: 2
please attention below picture, you will see some space and some rule. Please consider it. If you don’t consider rules, netplan can’t detect your configuration.
After adding IP static and other information on the file, save, and exit.
Point: you could save and exit with Ctrl + x key and press Enter key twice.
Apply configuration with the following command.
sudo netplan apply
Ok, now you can check Network configuration by ping your IP or ip addr command.
In this article, we try to set an IP static on ubuntu 20.04. If you have any questions about this post, you can comment below or ask your question on the Eldernode Ask page.
Also, you could see the video on the Eldernode Youtube channel.