How to Assign Static IP Address to Ubuntu 20.04 LTS

    It is always recommended to assign a static IP address to the Linux system as the static IP address remains constant during reboot. Canonical has recently released its stable Ubuntu 20.04 LTS (Focal Fossa) operating system for desktops and servers. This article shows how to assign a static IP address to the Ubuntu 20.04 LTS server and desktop.

    Ubuntu 20.04 Assigning a static IP address to the LTSserver

    In the Ubuntu LTS 20.04, the network configuration is monitored and controlled by the network plan program. But during installation, cloudinit configures a dynamic ip to the server interface when the dhcp server is available. So, to configure a static IP, we first need to make sure that the network interface is not managed by the cloud-init.

    Open the file cloud-init /etc/cloud/cloud.cfg.d/subiquity-disabled cloudinit-networking.cfg and make sure the network: {config: disabled} field is present. If this record is missing, add it manually.

    Disable email security]:~$ cat /etc/cloud/cloud.cfg.d/subiquity cloudinit-networking.cfg
    Network: {configure: disabled}
    [Email security]:~$

    Use the ip addr show command from the console to display the IP address,

    [Secure email]:~$ ip add show]

    As you can see above, the enp0s3 interface card is automatically assigned a dynamic IP. To make this IP address static, we need to edit the netplan configuration file /etc/netplan/00-installer-config.yaml.

    email protection]:~$ sudo vi /etc/netplan/00-installer-config.yaml
    # This is a network configuration written by the subquity network
    terrestrial networks :
    enp0s3 :
    dhcp4 : real version
    : 2

    The above standard inputs show that the enp0s3 interface receives an IP from a DHCP server. Since this is a jaml file, we need to make sure that the correct indentation is used when making changes to the file. Add the following lines to the yaml file,

    network:air:enp0s3 : addresses :]Gateway4: 1 name server: addresses:,] Version : 2

    to save and close the file.

    Execute the following grid plan apply command to apply the changes described above.

    [secure email]:~$ apply sudo netplan
    [secure email]:~$

    Now run the ip addr show and ip route show commands to see the IP address and route details.

    [Protected email]:~$ ip add show
    [Protected email]:~$ ip route show

    The retirement of the above team will be similar to that of the team below,

    The result confirms that the static IP address has been successfully assigned to the enp0s3 interface. Even if we reboot the server, this IP address remains consistent.

    Now let’s go to the Ubuntu 20.04 LTS office.

    Assignment of a static IP address for the Ubuntu office 20.04 LTS

    The network configuration of the Ubuntu desktop is checked by the network administrator. It is very easy to configure a static IP address on your Ubuntu 20.04 desktop. Log in to your desktop environment, click on the network icon and select your wired network settings.

    In the next window, click on the gear symbol below the wired option,

    In the next window, select the IPV4 tab, then select Manual and enter the IP address, Netmask, Gateway, and the IP address of the DNS server.

    Click Apply to save these changes and we need to disable and enable the interface once to assign an IP address.

    After turning the interface on and off and assigning a static IP address to the interface, we can check this by looking at the Details tab in the Wired Settings tab.

    Ideally, the above confirms that the static IP address has been successfully assigned to the interface. This is the end of the article; I hope these steps will help you to configure a static IP address on the Ubuntu server and the 20.04 LTS desktop. Give us your feedback and comments.ubuntu server 20.04 static ip address,ubuntu 20.04 static ip command line,ubuntu 20.04 set static ip command line,set static ip ubuntu 20.04 server,ubuntu 20.04 server static ip,ubuntu 20.04 network configuration command line,set static ip ubuntu 18.04 server,ubuntu 20.04 server network configuration

    Recent Articles

    More attackers using Exploits from Zero Day

    A examine this 12 months by FireEye has discovered that extra attackers used zero day exploits of their cyber assaults in 2019 than in...

    Windows 10 Build 20211 allows you to access Windows and WSL 2 Linux file systems.

      Dev Channel Insiders are in for a deal with this week. Home windows 10 Construct 20211 introduces numerous new options, together with including Search...

    Arch Linux Based Distribution from A Beginner

      If you’re in search of an Arch-based newbie’s Linux distribution and simpler to make use of and set up, gives all attainable desktop environments...

    Zerologon: How Bitdefender protects consumers from this Post-Exploit No-Credential Technique

      Zerologon is a zero-credential vulnerability that exploits Home windows Netlogon to permit adversaries entry to the Lively Listing area controllers, first reported in August...

    Hackers gather intelligence on potential opponents of the regime in Iran

      Iranian Group Discovered Spying on Dissidents An Iran linked group, named Rampant Kitten by researchers, has been found focusing on anti-regime organizations in a marketing...

    Related Stories