How to Set a Static IP Address in Ubuntu

In this article we will try to teach you how to Set Static IP Address in Ubuntu Linux. A static or fixed IP address is an IP address that does not change. Regardless of whether you reboot your device or your home router, your device with a static IP address will get the same IP address. The opposite of a static IP address is the dynamic IP address. A device without a static IP address is assigned a dynamic IP address by the DHCP (Dynamic Host Configuration Protocol) server, which can change from time to time.

By default, a device connected to your home router, whether it’s using a cable or connected via WiFi, will most likely get a dynamic IP address. And if you are also using your Ubuntu Managed VPS as an FTP server or web server, you will want to configure a static IP address for it so that you can reach the server with the same IP address. Below we have mention the steps to configure Static IP address in Ubuntu 20.04.

How to Configure Static IP Address in Ubuntu 20.04

How to Set Static IP Address on Ubuntu Server Using Netplan

Step 1: Open your terminal and head over to the /etc/netplan directory. You will find a YAML configuration file which you will use to configure the IP address.

Step 2: In our case the YAML file is 01-network-manager-all.yaml with the default settings as shown.

Step 3: For the Ubuntu server, the YAML file is 00-installer-config.yaml and these are the default settings.

Step 4: To configure a static IP, copy and paste the configuration below. Be mindful of the spacing in the YAML file.

network:version: 2ethernets:enp0s3:dhcp4: falseaddresses: [192.168.2.100/24]gateway4: 192.168.2.1nameservers:addresses: [8.8.8.8, 8.8.4.4]

Step 5: Next, save the file and run the netplan command below to save the changes.

$ sudo netplan apply

Step 6: You can thereafter confirm the IP address of your network interface using the ifconfig command.

$ ifconfig

Final Words

We hope our article on how to How to Configure Static IP Address on Ubuntu 20.04 will help you and resolve all your problems. Ubuntu is a Linux-based operating system. It is designed for computers, smartphones and network servers. The system is made by a UK based company called Canonical Ltd. developed. All the principles used to develop the Ubuntu software are based on the principles of open source software development. If you want to know how to set Static IP Address on Ubuntu Linux then follow the steps mentioned above.

I hope you understand this article, How to Set a Static IP Address in Ubuntu.

James Hogan
James Hogan
James Hogan is a notable content writer recognized for his contributions to Bollyinside, where he excels in crafting informative comparison-based articles on topics like laptops, phones, and software. When he's not writing, James enjoys immersing himself in football matches and exploring the digital realm. His curiosity about the ever-evolving tech landscape drives his continuous quest for knowledge, ensuring his content remains fresh and relevant.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related Articles

Hubspot Service Hub review 2024: a comprehensive platform

When it comes to customer support operations, HubSpot Service Hub is an all-encompassing customer service platform that is meant to...
Read more
When players on Windows 11 or 10 try to log in to Steam, they may get the error code E87....
Users of Windows 11 or 10 may find it frustrating to deal with the error number 147-0 in Microsoft Office....
The Microsoft Store is an important part of the Windows operating system because it gives users a single place to...
It can be hard to find the right balance between usefulness, durability, and cost when it comes to kitchen storage....
Both AirDroid and Vysor are well-known tools that help Android users control their devices and mirror them. One of the...