October 29, 2020

Fedora -- Setting up a static IP

For whatever reason, the Fedora installer does not let you set up a static IP. It instructs you to use the desktop configuration tools for that, whatever they may be. This is worth knowing how to do, both to "fix" the usual "automatic/DHCP" setup that the installer generates, and in case you need to change the configuration of a machine that is already using a static setup.

I run the XFCE spin, so any instructions relating to how to do this via gnome are useless. You can hack on the files in /etc/sysconfig, but it seems better to use the tools provided to play nicely with Network Manager.

Under "Settings", XFCE has an entry "Advanced Network Configuration". Too bad it isn't simply "Network Configuration" so you can find it scanning alphabetically for "N". Select "Wired network connection", click the gear thing at the bottom to edit it, and then locate the IPv4 tab and have at it.

The problem so far is that this works sometimes and not others. Mostly not. I use "ifconfig -a" to see what IP number my network is actually using, and then do this:

su
systemctl restart NetworkManager.service
ifconfig -a
I don't see the changes take affect. So I try restarting the system. That works! A good old microsoft Windows reboot is required sometimes. I'll blame NetworkManager, since it has in general been a source of misery and suffering.

From the command line

This is easier yet. You need to edit the file /etc/sysconfig/network-scripts/ifcfg-NAME. In my case this was ifcfg-Wired_connection_1. Once again, after editing this, simply restarting the NetworkManager.service was useless, but a reboot got the job done. Be sure to reset the hostname using "hostnamectl set-hostname waldo" before the reboot.

Setting the hostname

This often goes hand in hand with changing an IP number.
hostnamectl set-hostname waldo


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org