Home Linux ServerLinux Fundementals How to configure Static IP on Ubuntu

How to configure Static IP on Ubuntu

by Thạch Phạm
Published: Last Updated on

How to configure Static IP on Ubuntu for newbie

Hi guys, Welcome back to the documentation library at AZDIGI. In today’s article, AZDIGI will share with you how to configure Static IP on Ubuntu, including the Ubuntu server and Ubuntu Desktop. If you are used to configuring with Windows or have configured through servers running RHEL/CentOS, then for Ubuntu, the configuration will be completely different, the configuration files and executable commands are different.

Therefore, I have written this article hoping that it will help you configure it quickly and successfully. With Ubuntu, we will configure it via Netplan. So what is Netplan? Let’s find out together before doing the configuration.


What is Netplan?

Since the release of version 17.10, Netplan has been the default network management tool on Ubuntu instead of theinterface configuration file at /etc/network/interface as before.

Netplan is used to configure the YAML syntax and to configure the network with Netplan, you need to create a YAML configuration file corresponding to the network card you use. Netplan currently supports 2 renderers, NetworkManager and Systemd-networkd. NetworkManager is mainly used on desktops and Systemd-networkd is used on servers without GUI.

In this article, AZDIGI will guide you through configuring on Ubuntu Server and Ubuntu Desktop, So let’s follow and do it with AZDIGI!

Configuration on Ubuntu Server

To configure, you need to determine the name of your ethernet network card. With Ubuntu, enter the ip link command to check.

AZDIGI Tutorial
ip link

At this point, the system will print out the network card information. As shown below, I have a Lookpack card and the main card is ens18.

configure Static IP on Ubuntu

Now open the configuration file to start configuring the IP. The netplan configuration files will be in the /etc/netplan path and the files with the extension will be .yaml.

configure Static IP on Ubuntu

My configuration file is 00-installer-config.yaml, use vi editor to edit the vi 00-installer-config.yaml file.

What you need to know in this configuration file is that each Netplan file will start with the keyword network and have at least 2 required elements that are.

  • version: Version parameter of the network
  • device type: Can be ethernets, bonds, bridges, or vlans

Below is my entire configuration in the file with comments on each line following the # symbol.

AZDIGI Tutorial
# This is the network config written by 'subiquity'
    ens18: #Tên card mạng
      - #Địa chỉ IP và Netmask của IP
      gateway4: #Địa chỉ gateway
        - #Nameserver
  version: 2 #Phiên bản network


After the configuration file adjustment is complete, enter the following command to apply the change and verify the change.:

AZDIGI Tutorial
netplan apply
ip addr show dev 
configure Static IP on Ubuntu

To check if there is a network, I do a Ping to the internet. Here I PING to google.com and the result was successful.

Screenshot 2020 12 23 at 20.57.34@2x

Configuration on Ubuntu Desktop

Ubuntu Desktop has an intuitive interface; To configure, follow the steps below.

First, go to Settings => select Network => click on the Gear icon to set up the network configuration.

configure Static IP on Ubuntu

Next, select the IPv4 tab => Manual and configure the Address frame.

  • Address: Please enter your IP.
  • Netmask: Please enter the Netmask address (if you do not know your netmask address, you can visit the link http://jodies.de/ to check)
  • Gateway: Enter your Gateway address.
configure Static IP on Ubuntu

Then you scroll down to the bottom and configure DNS, here I configure Google DNS as If you configure more DNS ranges, use commas “,” and add it. For example,, After successfully entering, click Apply to apply the changes.

configure Static IP on Ubuntu

Now turn on the connection by clicking the button below to turn it off/on.

configure Static IP on Ubuntu

To check if the device has successfully configured the network, I will open the Terminal window and PING out. I performed PING and the result was received successfully.

configure Static IP on Ubuntu

Now enter the website name into the browser to check the access results. As you can see, the result below shows that it has been successful.

configure Static IP on Ubuntu


So you have completed the steps to configure the network on Ubuntu. “It’s really easy when you follow the documentation, isn’t it?” Hopefully, this article will help you learn more about configuring and operating your server.

Wishing you success!

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign