The most effective method to Configure Static IP Addresses On Ubuntu 20.04 Server simple way.
Setup Static IP address on Ubuntu Server
To do as such, utilize the ip connect order, as displayed underneath:
To allot a static IP address on the organization interface, open the YAML setup record with your word processor :
sudo nano /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: yes
Prior to changing the arrangement, how about we clarify the code in a short.
Each Netplan Yaml document begins with the organization key that has somewhere around two required components. The initially required component is the adaptation of the organization design, and the subsequent one is the gadget type. The gadget type can be ethernets, bonds, spans, or vlans.
The arrangement above likewise has a line that shows the renderer type. Out of the container, in the event that you introduced Ubuntu in worker mode, the renderer is arranged to utilize networkd as the back end.
Under the gadget's sort (ethernets), you can determine at least one organization interfaces. In this model, we have just a single interface ens3 that is arranged to get IP tending to from a DHCP worker dhcp4: yes.
Prior to changing the setup, we should clarify the code in a short.
Each Netplan Yaml record begins with the organization key that has something like two required components. The originally required component is the variant of the organization setup design, and the subsequent one is the gadget type. The gadget type can be ethernets, bonds, spans, or vlans.
The setup above additionally has a line that shows the renderer type. Out of the crate, in the event that you introduced Ubuntu in worker mode, the renderer is arranged to utilize networkd as the back end.
Under the gadget's sort (ethernets), you can indicate at least one organization interfaces. In this model, we have just a single interface ens3 that is designed to get IP tending to from a DHCP worker dhcp4: yes.
To relegate a static IP address to ens3 interface, alter the document as follows:
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 192.168.9.12/24
gateway4: 192.168.9.1
nameservers:
addresses: [8.8.8.8, 8.8.1.1]
When altering Yaml records, ensure you observe the YAML code indent principles. On the off chance that the sentence structure isn't right, the progressions won't be applied.
Once done, save the record and apply the progressions by running the accompanying order:
sudo netplan apply
End
We've told you the best way to design a static IP address on Ubuntu 20.04.
On the off chance that you have any inquiries, kindly leave a remark underneath.
