Network aliases on boot on Fedora 17

Mike asked:

We have a fedora server(Fedora release 17 (Beefy Miracle)) with a few aliases on the main NIC that don’t get setup during boot. Here’s my config:

# cat /etc/sysconfig/network-scripts/ifcfg-em1*
DEVICE="em1"
UUID="ab2ad60a-c916-45b5-81c5-d1534e0bc36a"
NM_CONTROLLED="yes"
BOOTPROTO="dhcp"
HWADDR="00:1C:C4:EC:43:4A"
ONBOOT="yes"
ISALIAS=yes
DEVICE=em1:0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.255.3
NETMASK=255.255.255.0
NETWORK=192.168.255.0
BROADCAST=192.168.255.255
TYPE=Ethernet
ISALIAS=yes
DEVICE=em1:1
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.255.4
NETMASK=255.255.255.0
NETWORK=192.168.255.0
BROADCAST=192.168.255.255
TYPE=Ethernet
ISALIAS=yes
DEVICE=em1:2
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.255.5
NETMASK=255.255.255.0
NETWORK=192.168.255.0
BROADCAST=192.168.255.255
TYPE=Ethernet
ISALIAS=yes
DEVICE=em1:3
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.255.23
NETMASK=255.255.255.0
NETWORK=192.168.255.0
BROADCAST=192.168.255.255
TYPE=Ethernet

Hardlinks are setup according to documentation I was reading.

# ls -lah /etc/sysconfig/networking/devices/
total 20K
drwxr-xr-x. 2 root root 4.0K May  8 09:33 .
drwxr-xr-x. 4 root root 4.0K Nov 15  2012 ..
-rw-r--r--. 3 root root  156 Jan 16 00:40 ifcfg-em1:0
-rw-r--r--. 3 root root  156 Jan 16 00:41 ifcfg-em1:1
-rw-r--r--. 3 root root  156 Jan 16 00:41 ifcfg-em1:2
# ls -lah /etc/sysconfig/networking/profiles/default/
total 20K
drwxr-xr-x. 2 root root 4.0K May  7 16:50 .
drwxr-xr-x. 3 root root 4.0K Nov 15  2012 ..
-rw-r--r--. 3 root root  156 Jan 16 00:40 ifcfg-em1:0
-rw-r--r--. 3 root root  156 Jan 16 00:41 ifcfg-em1:1
-rw-r--r--. 3 root root  156 Jan 16 00:41 ifcfg-em1:2

The aliases work great when setup with the commands like this:

# ip addr add 192.168.255.3/24 brd + dev em1 label em1:0

However, they never come up on boot, or after the physical network connection is disconnected. All the docs I’ve read suggest this is the correct way to do this, but on every boot, we have to set it up manually.

My answer:


All of the docs you’ve read are horribly out of date. This is not the expected way to add IP addresses to an interface anymore.

Instead, you should use only ifcfg-em1 and specify all of the IP addresses in that file.

IPADDR=192.168.255.3
PREFIX=24
IPADDR2=192.168.255.4
PREFIX2=24
IPADDR3=192.168.255.5
PREFIX3=24
IPADDR4=192.168.255.6
PREFIX4=24

The ifcfg-em1:* files should just be deleted.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.