How to configure a static IP address on Fedora

In this tutorial, we guide you through configuring a static IP address on Fedora 31 Workstation using the two most common methods, GUI and command-line way.

Each system administrator should be aware of the importance of providing a static IP to a Fedora workstation. You can connect and remotely control your PC from a set IP address from any corner of the world. This is just the tip of what most people do.

Without further ado, let’s guide you through configuring a static IP address on Fedora 31 Workstation using the two most common methods, GUI and command-line way.

Configuring Fedora 31 to have a static IP address

Before starting the tutorial, ensure that your Fedora 31 is completely updated using the following two commands or use Fedora Software Update.

sudo dnf update
sudo dnf upgrade

Method 1: Setting static IP address on Fedora 31 using GUI

Step 1. From the top left of your Fedora 31 desktop, open the Activities tab.

Open The Activities Tab
Open The Activities Tab

Step 2. In the search bar, search for the settings application and open it.

Search and Open Settings Application
Search and Open Settings Application

Step 3. From the left panel of the Settings app, select the Network tab.

Open Network Tab
Open Network Tab

Step 4. Now on the right side, open the system network interface setting.

Open Settings For the System Network Interface
Open Settings For the System Network Interface

Step 5. It should be something like shown in the screenshot below. Notice the current IP address.

Settings Of System Network Interface
Settings Of System Network Interface

Step 6. In the top panel, select the IPv4 tab.

Open IPv4 Tab
Open IPv4 Tab

Step 7. Now let’s select the Manual option.

Select The Manual Option
Select The Manual Option

Step 8. In the Addresses field, write down your static IP with the Netmask alongside the gateway. But be careful not to choose an already used IP because that will cause a network IP conflict.

Assign IP Address
Assign IP Address

Step 9. In case if you need to set the DNS.

Assign DNS
Assign DNS

Step 10. When done, click the Apply button in the top right of your window to save all your changes.

Press The Apply Button To Save Your Configuration
Press, The Apply Button, To Save Your Configuration

Step 11. You should restart your network connection to apply changes. So let’s turn off the system network interface.

Turn Off The Wired Setting
Turn Off The Wired Setting

Step 12. Turn it ON again.

Turn On The Wired Settings
Turn On The Wired Settings

Step 13. Let’s check if the static IP was configured or not. Open the system network settings.

Open The System Network Settings
Open The System Network Settings

Step 14. You should see the new static IP configured successfully alongside the DNS.

IP and DNS Configured Successfully
IP and DNS Configured Successfully

Method 2: Applying a static IP address on Fedora 31 by command-line

In this method, we will be using the “nmcli” command to configure static IP on Fedora 31.

Step 1. First, we need to get the name of the current network connection and its unique ID.

 sudo nmcli connection show

Obtain The Name Of Your Network Interface
Obtain The Name Of Your Network Interface

As you can see in the above screenshot, the network name is marked with the red line, and the unique network ID is marked with the blue line.

Step 2. Get the current IP of your network using the following command.

ip addr show name_of_your_network

name_of_your_network –> Network name obtained in the previous step.

Get The Current IP Address
Get The Current IP Address

Step 3. Now let’s change the current IP to a static one. Use the command:

sudo nmcli connection modify network_uuid IPv4.address static_IP/24

network_uuid –> Network unique ID obtained in the first step.

static_IP –> Your static IP, but be careful not to choose an already assigned IP because that may cause a network conflict.

Set IP Address Manually
Set IP Address Manually

Step 4. Set the network gateway using the following command.

sudo nmcli connection modify network_uuid IPv4.gateway network_gateway_IP

network_uuid –> Network unique ID obtained in the first step.

network_gateway_IP –> Your Network Gateway.

Set Geteway Manually
Set Gateway Manually

Step 5. Set network DNS.

sudo nmcli connection modify network_uuid IPv4.dns 8.8.8.8

network_uuid –> Network unique ID obtained in the first step.

Set DNS Manually
Set DNS Manually

Step 6. Set the network configuration method to be manual.

sudo nmcli connection modify network_uuid IPv4.method manual

network_uuid –> Network unique ID obtained in the first step.

Change Configuration Method To Manual
Change Configuration Method To Manual

Step 7. Next, we need to restart the network to apply all the changes. So first, we will turn the network off using the next command.

sudo nmcli connection down network_uuid

network_uuid –> Network unique ID obtained in the first step.

Turn Off Your Network
Turn Off Your Network

Step 8. Now let’s turn the network on again.

sudo nmcli connection up network_uuid

network_uuid –> Network unique ID obtained in the first step.

Turn On Your Network
Turn On Your Network

Step 9. Let’s check if the previous changes were applied or not. Use the following command to get the current network IP.

ip addr show name_of_your_network

name_of_your_network –> Network name obtained in the first step.

IP Configured Successfully
IP Configured Successfully

As you noticed, all the changes have been applied successfully. That’s all about configuring your Fedora system to have a static IP address. I hope you enjoyed this tutorial.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

1 COMMENT

  1. Thanks for your article.
    But is there a config file where we can setup the network config like in debian “/etc/network/interfaces” ?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,521FansLike
364FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to setup FTP Server on CentOS

You are allowed to use any one of the FTP servers as you like. However, in this tutorial, we will be installing and using vsftpd, short for Very Secure FTP Daemon. It is a fast, stable, and secure FTP server that will help you transfer files to and from a remote system in a jiffy.

CentOS Vs. Ubuntu Server : Everything You Need to Know

Choosing the perfect Linux distribution to set up your server can be confusing since Linux provides a limitless number of options. The main reason behind these many distributions is because Linux is an opensource platform. Anybody with the required skills can contribute to the development or build and release their distribution. Currently, there are more than 600 Linux Desktop and Server distributions in the market.

Top 10 Reasons to use Xfce as your Desktop Environment

There are many choices for desktop environments for Linux based operating systems. Mainly, you can install any DE of your choice on most of the Linux based distributions, even if they are not offered as a package officially. In our recent articles, we discussed the best of KDE and Cinnamon. In this article, we wish to present to you the top reasons why you should consider Xfce as your desktop environment.

The 10 Best Linux Network Monitoring Tools

Having total control over your network is essential to prevent programs from overusing your network resources and slowing down the overall performance. This is why you should install a network monitoring tool on your system, giving you a visual overview of everything that's happening on your network. Networking Tools are like swiss-knife for the system administrators for troubleshooting system issues.

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.

5 ways to send emails using the command-line in Linux

Did you master using the command-line in Linux? There is no limit to what one can do via the Linux Terminal. One of such things we are going to discuss today are methods of sending an email using the command-line.

10 top reasons to switch to Manjaro Linux

Manjaro is Linux distro based on Arch-Linux which follows a rolling release model. Is this distro good for you? Let's find out the main reasons for using Manjaro.

What’s New in Ubuntu 20.04 LTS “Focal Fossa”

Ubuntu 20.04 LTS is out now! This is the successor to Ubuntu 18.04, which was released in April 2018 and still has three years of official support left. Code-named Focal Fossa, the new edition has all the bells and whistles included in it, making it one of the best Ubuntu releases yet. Let's find out more.