How to Configure Static IP Address on Fedora Linux

Hi techies, as we know Fedora is one of popular open source Linux based operating system. Fedora Linux can be used as workstation, Server, and CoreOS.

In this guide, we learn how to manually configure static ip address on Fedora Linux (Fedora 40 Workstation). A static IP address is an IP address that stays the same over time and remain persistent across the reboot. There are two different ways to configure static IP.

  1. nmcli utility (Command Line)
  2. Graphically

Configure Static IP address on Fedora 40 Using nmcli

The nmcli is a command line utility and used to configure a static IP address on Fedora Linux. To use this command, you must first open a terminal window (Ctrl+Alt+T). Then, you will need to type in the following commands:

$ nmcli connection show
$ nmcli

This will show you a list of all the connections that are currently configured on your system.


In my case, my Fedora system is connected to modem and got the IP from DHCP server. Now to make the IP address static and persistent, run following nmcli commands.

Following commands will modify the existing connection name ‘Wired Connection 1

Run beneath command to add static ip address along with the gateway ip.

$ sudo nmcli con modify 'Wired connection 1' ifname enp0s3 ipv4.method manual ipv4.addresses gw4

To add DNS IP address, run

$ sudo nmcli con mod 'Wired connection 1' ipv4.dns

To make above changes into the effect, disable and enable the connection,

$ sudo nmcli con down 'Wired connection 1'
$ sudo nmcli con up 'Wired connection 1'

Verify the ip address using ip command,

$ ip a s

Output of above commands would like below,


In case, you don’t want to use the existing connection and want to create new connection for configuring the static IP address, run following commands one after the another,

$ sudo nmcli con add type ethernet con-name 'static-fedora' ifname enp0s3 ipv4.method manual ipv4.addresses gw4
$ sudo nmcli con mod 'static-fedora' ipv4.dns
$ sudo nmcli con up 'static-fedora'
$ ip a s enp0s3

Assign Static IP Address on Fedora 40 via Graphically

Note: For this method to work, make sure desktop environment is installed on your fedora system.

Login to the desktop environment, go to Settings and then choose Network


Click on gearbox icon,

In following window, Choose IPv4,


Choose ‘Manual’ to assign static ip address, gateway and DNS IP.

Specify details as below:

  • IP address:
  • Netmask:
  • Gateway IP:
  • DNS IP:

Note: Replace the IP details as per your environment.


Click on Apply.

Now disable and enable the interface to make above changes into the effect.


Close the window and open the terminal and run ip command to verify the ip address.


Prefect, above commands output confirm that static IP address has been configured successfully on our Fedora Linux.

That’s all from this guide. In case you have found it informative, so please do share it among your technical friends.

Share on:

I am a Cloud Consultant with over 15 years of experience in Linux, Kubernetes, cloud technologies (AWS, Azure, OpenStack), automation (Ansible, Terraform), and DevOps. I hold certifications like RHCA, CKA, CKAD, CKS, AWS, and Azure.

1 thought on “How to Configure Static IP Address on Fedora Linux”

Leave a Comment