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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,851FansLike
265FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to create a bootable CentOS Live USB drive on Windows

create centOS Live USB drive
CentOS ISO downloads are available in two different variations - Minimal ISO and DVD ISO. So what are these? In this guide, you will know how to create a CentOS Live USB drive that can also be used to install CentOS.
PDF EDITORS LINUX
In this article, we will take a look at 10 of the best PDF editors and tools out there in 2019 that are available for Linux platforms. The editors are going to be judged on the basis of their functionalities, portability, ease of installation, price, and convenience.
clipboard manager linux
We have all had that moment when we copied a text, but we first needed another one, and in the process, lost the first one. If you're lucky, you can get it back quickly with a bit of work.