In Fedora 18, when updating ifcfg-eth0, the new settings do not apply

fedoranetworkingnetworkmanagerstatic-ip

I am aware that many people prefer to disable NetworkManager, but I don't believe it will be going away and I decided to try to learn how to use it properly. I thought I would begin with something simple, like setting a static IP.

I updated /etc/sysconfig/network-scripts/ifcfg-eth0 to match the settings I want it to have, then saved the file. From what I have read, NetworkManager is supposed to update the settings immediately, but it does not. In fact, after both restarting NM and after a reboot, eth0 keeps using dhcp. I am using a minimal install of Fedora 18 and have installed dhcp, but not yet configured it. ifconfig is no longer part of a minimal install, apparently it is headed towards deprecation.

Below is my ifcfg-eth0 file.

HWADDR=00:0C:29:DF:87:72
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=b15e1bf2-60b5-4469-9c68-88ae05e33301
ONBOOT=yes
IPADDR=10.0.0.1
NETMASK=255.255.255.0
GATEWAY=10.0.0.254
DNS1=10.0.0.1
DNS2=8.8.8.8

Below is output from ip addr:

#ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:24:75:2f brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.129/24 brd 10.0.0.255 scope global eth0
    inet6 fe80::20c:29ff:fe24:752f/64 scope link
       valid_lft forever preferred_lft forever

Below is /etc/sysconfig/network:

NETWORKING=yes

Best Answer

The MAC address of your actual interfaces differs from your configured ifcfg script. It is likely ignoring the script because the MAC doesn't match. This is usually a safeguard to avoid adding IP addresses to the wrong interfaces in case the ifcfg-eth# names changed.

Try updating the HWADDR line in your file to be HWADDR=00:0c:29:24:75:2f. If this isn't the MAC you are expecting (as the name could have changed if this system has 2 NICs) you might also be interested in checkout out the /etc/udev/rules.d/70-persistent-net.rules file.

One last thing to note, this is coming from my knowledge of RHEL 5/6 and it looks like there is also a UUID in your more up to date Fedora implementation. If still have issues after fixing the MAC, you might try removing the UUID (I'm not sure how to verify that on Fedora).