A static IP address is an Internet Protocol (IP) address that remains the same even when your computer is connected to Wi-Fi. You may need a static IP address for several reasons, such as if you have multiple devices on your home network and you want to make sure they can use their respective IP addresses to communicate. If you’re using your computer as a server, it may also be necessary so that other devices can find it at all times. Configuring a static IP address on Fedora is easy and you will learn how in this article.
We will discuss 2 methods for configuring static IP addresses on Fedora using GUI and terminal.
Method 1: Configuring Static IPv4 Address on Fedora with GUI
The Fedora Desktop editions provide a graphical user interface for managing the system configuration. You can quickly configure the network interfaces using GUI. Follow the below steps to configure a static IP address on Fedora Desktop systems.
- Open Settings:
- Log in to the Fedora desktop system with a privileged account.
- Search and open system Settings on your system
- Open Network Settings:
- Select the Network tab in the left sidebar
- You will see the Wired section, Click the gear icon as shown below screenshot
- IPv4 Settings:
- You will see the Details tab, here you can find the current system IP details
- Go to the IPv4 section
- Set a new IP address:
- In the IPv4 Method select “Manual” option.
- In the Addresses section, set the new IP address, Netmask, and the Gateway.
- In the DNS section, set the IP address of your DNS server. In the below screenshot, I have used 126.96.36.199 (Google public DNS server) and 192.168.1.2 (local DNS server)
- Click the Apply button at top-right corner
- Disable and Enable Networking:
Now, disable the networking and enable it again to apply the changes immediately.
- All done
Congratulations you have successfully configured a static IP address on the Fedora desktop system.
Method 2: Configuring Static IPv4 Address on Fedora with CLI
The fedora provides nmcli command-line tool for managing NetworkManager. In this method, we will help you to configure the static IP address on Fedora system via command line.
- First check the current network settings and identify the interface name:
- Set the static IP address to ‘Wired connection 1’. The below command uses folloiwng settings. Here:
- Connection Name: ‘Wired connection 1’
- Interface Name: eth0
- IP Address & Netmask: 192.168.1.210/24
- Gateway Address: 192.168.1.2
sudo nmcli con modify 'Wired connection 1' ifname eth0 ipv4.method manual ipv4.addresses 192.168.1.210/24 gw4 192.168.1.2
- If required, you can also update the DNS server settings.
sudo nmcli con mod 'Wired connection 1' ipv4.dns 188.8.131.52,184.108.40.206
- Down and Up the network connection.
sudo nmcli con down 'Wired connection 1' && sudo nmcli con up 'Wired connection 1'
- Again check the IP address of your system.
How to Check IP Address on Fedora
Press CTRL + ALT + T to launch the terminal on your Fedora system. Now type the following IP command to view all IP addresses configured on your system.
ip addr show
This tutorial describes 2 methods for configuring static IP addresses on the Fedora system using a graphical user interface and a command line interface.