Fedora 22: Setting a static IP address

Fedora 22: Setting a static IP address

This is a quick tutorial on how to set a static IP address using the terminal within Fedora 22.

Disable Network Manager

1. First stop and disable the gnome network manager from running on boot.

systemctl stop NetworkManager.service
systemctl disable NetworkManager.service

2. Now start and enable the network service to run on boot.

systemctl restart network.service
systemctl enable network.service

Set the Static Address

1. Check which interface(s) you want to set as static.

[[email protected] ~]# ifconfig
em1: flags=4163 mtu 1500
inet netmask broadcast
inet6 fe80::dad3:85ff:feae:dd4c prefixlen 64 scopeid 0x20 ether d8:d3:85:ae:dd:4c txqueuelen 1000 (Ethernet)
RX packets 929 bytes 90374 (88.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1010 bytes 130252 (127.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 19

lo: flags=73mtu 16436
inet netmask
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 32 bytes 3210 (3.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 3210 (3.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

2. Next edit the config file for the required interface.

vi /etc/sysconfig/network-scripts/ifcfg-em1

3. Edit the config file to look similar to the following.

Change the BOOTPROTO from “dhcp” to “static”. Also adding IPADDR, NETMASK, BROADCAST and NETWORK variables and make sure ONBOOT is set to yes.


Apply the Settings

Restart the network service to apply the settings.

systemctl restart network.service

Configure DNS

Make sure the correct DNS servers are configured to allow Fedora to resolve domains.

vi /etc/resolv.conf

Leave a Reply

5 Comments on "Fedora 22: Setting a static IP address"

Leave a Reply

Sort by:   newest | oldest | most voted

I did all of this, and ended up with a non-functional connection–resolv.conf was impossible to edit. I ended up re-disabling network.service, enabling and restarting NetworkManager.service, and editing the DNS servers through the GUI. Looks like Network Manager handles static IPs just fine. Why shut it off?

Janet Cruz

I have Fedora 25 and using the NetworkManager GUI by itself would not change the settings, so I followed the instructions above and also got errors when I did

systemctl enable network.service

nonetheless I edited the ifcfg-em1 file and tried restarting the network.service but nothing worked. I had to restart the computer and when it came back up I did

systemctl enable NetworkManager.service

systemctl restart NetworkManager.service
and opened the NetworkManager GUI and to my surprise all the settings were what I had changed them to.


The above instructions work, with a minor correction and one addition. First, in /etc/sysconfig/network-scripts/ifcfg-


– should be –


And you need to unlink resolv.conf:

# unlink /etc/resolv.conf

Then you should be able to create a new resolv.conf and save. Everything should work by following the rest of the instructions above.