Edited 8 hours ago by ExtremeHow Editorial Team
FedoraStatic IPNetwork ConfigurationEthernetWi-FiCommand LineTerminalSystem AdministrationConfigurationComputers
This content is available in 7 different language
In the world of networking, Internet Protocol (IP) addresses are crucial for communication between devices. In Fedora, configuring a static IP address can increase the reliability of network services, such as web hosting or file servers, that require constant network connectivity. This guide provides a comprehensive walkthrough on configuring a static IP address on the Fedora Linux distribution.
Configuring a static IP ensures that your device maintains the same IP address on the local network even if it is restarted, preventing disruptions in network communications. Here's how to effectively configure a static IP address step-by-step.
Before you proceed with the configuration process, make sure you have the following:
Start by identifying your network interfaces. This information helps you understand which network interface you need to configure. To list all network interfaces, use the following command:
ip a
This command will display all network interfaces and their current IP configuration. Look for interface names like eth0
, ens33
, or wlp2s0
.
Fedora uses NetworkManager
to manage network settings. By default, it is installed. However, you can verify its presence or install it using:
sudo dnf install NetworkManager
Make sure NetworkManager
is running:
sudo systemctl start NetworkManager
sudo systemctl enable NetworkManager
Fedora provides nmcli
tool, a command-line client for NetworkManager
, to configure network interfaces. Follow these steps:
Identify the network connection you want to configure. Use:
nmcli connection show
This displays all existing connections. Note the name of the connection associated with the interface you identified earlier.
Modify the connection to use a static IP address. Assuming your connection name is "Wired connection 1"
, you want to set the IP to 192.168.1.100
, the subnet mask to 255.255.255.0
(often written as /24
) and the gateway to 192.168.1.1
. Use:
sudo nmcli connection modify "Wired connection 1" ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8 ipv4.method manual
This sets the desired static IP address, gateway and DNS server, which in this case is Google’s public DNS 8.8.8.8
.
Reactivate the network connection to apply the changes:
sudo nmcli connection up "Wired connection 1"
This command restarts the connection, applying the static IP settings you configured.
After configuring a static IP, it is important to verify that it is set up correctly. Check the current IP configuration of the interface by using the following:
ip a
Make sure the IP address displayed matches the one you set. You can also test connectivity via a ping test to your gateway or another known IP address:
ping -c 4 192.168.1.1
If you receive responses, your static IP setup is functional.
Fedora provides a graphical user interface (GUI) as an alternative to the command-line method. Here's how you can set up a static IP using the GUI:
If you experience problems with static IP setup, consider the following troubleshooting steps:
Configuring a static IP address on Fedora is a straightforward, yet powerful task that can increase the reliability and predictability of network services. By following this guide, you can ensure consistent network performance and prevent unnecessary network problems caused by dynamic IP changes.
Whether using nmcli
for a command-line approach or navigating through a GUI, Fedora provides flexible tools to effectively manage network settings. Understanding these methods gives you greater control over network configuration, meeting the needs of both personal and business environments.
In addition, the skill to diagnose and troubleshoot network settings ensures that you can quickly resolve any connectivity challenges that may arise while using Fedora.
If you find anything wrong with the article content, you can