You just finished building a home lab server or a dedicated development workstation
You assigned a fixed IP address in your router settings, but every time Fedora reboots, the machine grabs a different address from the DHCP pool. Your services break. Your SSH keys stop working. You need the network interface to stick to one address, no matter what.
What is actually happening
Fedora does not configure network interfaces directly through traditional ifcfg files anymore. It uses NetworkManager as the central brain for all network connections. NetworkManager separates the physical hardware from the configuration profile. The interface name might be enp3s0 or eth0, but NetworkManager tracks a connection profile that holds the IP, gateway, DNS, and routing rules. When you boot, NetworkManager matches the hardware to the profile and applies the settings. If the profile says automatic or DHCP, the system asks the router for an address. If you want a static IP, you must tell the profile to stop asking and start using the values you provide.
The GUI settings panel and the nmcli command line are not different systems. They are two windows into the exact same configuration database. Changing a setting in one place instantly updates the other. The only difference is how you interact with it. NetworkManager stores these profiles as text files in /etc/NetworkManager/system-connections/. The files in /usr/lib/NetworkManager/ ship with the package and contain system defaults. Edit only the /etc/ directory. Never touch /usr/lib/.
Run nmcli connection show before you change anything. Read the current state before guessing.
The GUI method
Open the system Settings application and navigate to the Network section. Select the active connection from the list. Click the gear icon next to the connection name to open the detailed configuration window. Switch to the IPv4 tab. You will see a dropdown menu labeled Method. Change it from Automatic to Manual.
A new field appears for Addresses. Enter your desired IP address followed by the subnet mask in CIDR notation. For a standard home or small office network, that is usually /24. Add the gateway address in the next field. This is the router IP that handles traffic leaving your local network. Add your DNS servers in the DNS field. Separate multiple servers with commas. Click Apply. NetworkManager will immediately deactivate and reactivate the connection to apply the new profile.
The GUI validates the subnet math before allowing you to save. If you enter an IP that falls outside the router range, the Apply button stays grayed out. This prevents you from locking yourself out of the network.
Apply the profile before you close the window. NetworkManager does not save draft changes.
The CLI method
The command line gives you precise control and works over SSH without a desktop environment. NetworkManager uses nmcli as its primary CLI interface. The first step is identifying the exact connection profile name. Interface names and connection names often differ. A profile named Wired connection 1 might be attached to enp3s0. You must use the profile name in nmcli commands, not the interface name.
Here is how to list all active connections and find the correct profile name.
nmcli connection show --active
# Lists only connections currently attached to hardware
# The NAME column is what you will use in subsequent commands
# Do not guess the interface name if the profile has a custom label
Once you have the profile name, you modify the IPv4 settings in a single command. NetworkManager allows you to chain multiple properties together. You must also clear any leftover DHCP settings to prevent conflicts.
Here is the exact command to set a static IP, gateway, and DNS server for a wired connection.
nmcli connection modify "Wired connection 1" \
ipv4.method manual \
ipv4.addresses 192.168.1.50/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns "8.8.8.8,1.1.1.1" \
ipv4.ignore-auto-dns true \
ipv4.ignore-auto-routes true
# ipv4.method manual tells NetworkManager to ignore DHCP
# ipv4.addresses sets the static IP and subnet prefix length
# ipv4.gateway defines the default route for outbound traffic
# ipv4.dns provides the recursive resolvers for name lookup
# ignore-auto-dns prevents DHCP from overwriting your DNS list
# ignore-auto-routes prevents DHCP from adding unwanted routes
Modifying the profile does not apply the changes to the live system. You must bring the connection down and back up, or simply activate the updated profile. If you are connected via SSH, NetworkManager will briefly drop the interface and reconnect it. Your session will pause but should recover automatically.
Here is how to apply the new configuration without dropping your SSH session.
nmcli connection up "Wired connection 1"
# Re-activates the connection using the modified profile
# NetworkManager gracefully replaces the old IP with the new one
# If you are over SSH, the session will briefly pause but reconnect
Always run nmcli connection reload after making manual edits to configuration files. The command forces NetworkManager to re-read the disk state and sync it with the runtime configuration. Skipping this step causes the GUI and CLI to show stale data.
Verify it worked
Run ip addr show to confirm the interface holds the correct address. Look for the inet line under your interface name. The output should match the IP and CIDR you configured. Run nmcli connection show "Wired connection 1" and scroll to the ipv4.addresses and ipv4.gateway lines. They must reflect your manual entries. Finally, test name resolution with ping -c 3 fedoraproject.org. If the ping resolves and returns packets, your DNS configuration is active.
Run ip route show to verify the default route points to your gateway. If the route is missing, outbound traffic will fail even if the local IP is correct. NetworkManager builds the routing table automatically when you set ipv4.gateway. If you see multiple default routes, the system will pick the one with the lowest metric.
Check the routing table before you deploy services. A missing default route breaks everything.
Common pitfalls and error recovery
The most frequent mistake is leaving DHCP enabled while adding a static address. NetworkManager will prioritize the DHCP lease and ignore your manual entry. The ipv4.method property must be set to manual or shared. If you forget this, the system will keep requesting an address from the router.
Another common issue involves DNS resolution failing after the IP change. Modern Fedora uses systemd-resolved for DNS caching and forwarding. If you set ipv4.dns in NetworkManager, the settings propagate automatically. If you see name lookup failures, check the resolver status.
# resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Link 2 (enp3s0)
Current Scopes: DNS
DefaultRoute setting: yes
DNS Servers: 8.8.8.8 1.1.1.1
DNS Domain: ~.
If the DNS Servers line is empty, NetworkManager did not pass the values correctly. Re-run the modify command and ensure the DNS string is quoted.
You may also encounter a refusal when trying to activate the connection. NetworkManager validates the configuration before applying it.
Error: Connection activation failed: Device not managed by NetworkManager.
This error appears when the interface is controlled by another tool, such as systemd-networkd or a manual ifup script. Fedora ships with NetworkManager as the default manager. If you see this error, check the device state.
nmcli device status
# Shows which tool controls each interface
# If the DEVICE column shows unmanaged, NetworkManager is ignoring it
# Check /etc/NetworkManager/NetworkManager.conf for unmanaged-devices rules
If you lock yourself out by assigning an IP outside your router range, you can recover using the ip command directly. This bypasses NetworkManager and applies to the current session only.
sudo ip addr add 192.168.1.50/24 dev enp3s0
# Temporarily assigns the IP to the interface
# sudo ip route add default via 192.168.1.1 dev enp3s0
# Restores outbound routing for the current session
# sudo nmcli connection up "Wired connection 1"
# Re-applies the correct persistent profile once you regain access
Config files in /etc/NetworkManager/system-connections/ are the persistent storage for these profiles. You can edit them directly, but it is safer to use nmcli or the GUI. Manual edits bypass validation and can break the connection profile. Always use the official tools to modify network state.
Reboot before you debug. Half the time the symptom is gone.
When to use this versus alternatives
Use the GUI when you are working on a desktop machine and prefer visual confirmation of the subnet and gateway fields. Use nmcli when you are managing servers, scripting deployments, or working over a remote SSH session without a display server. Use nmtui when you need a terminal-based interface but want menu navigation instead of typing long commands. Stick to NetworkManager when you want seamless roaming, VPN integration, and automatic fallback to DHCP. Switch to systemd-networkd only when you are building a minimal container host or an embedded appliance that does not need desktop network features.
Trust the package manager. Manual file edits drift, snapshots stay.