RHEL 6 NetworkManager and secondary IP addresses

configurationip addressnetworkmanagerrhel6

I've got two hosts running the same release of RHEL (6.4).
I've been given eight IP addresses to put onto one NIC in each host.

On host A, I manually created ifcfg-eth0, ifcfg-etho:1, ifcfg-etho:2, ifcfg-etho:3, ifcfg-etho:4, ifcfg-etho:5, ifcfg-etho:6, ifcfg-etho:7
ifcfg-eth0 looks like this:

HWADDR=xx:xx:xx:xx:xx:xx
TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=none
IPADDR=xx.xx.xx.xx
PREFIX=24
GATEWAY=xx.xx.xx.xx
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=VLAN20
ONBOOT=yes

In the secondary interface files, I put this:

DEVICE=eth0:x
IPADDR=xx.xx.xx.xx
PREFIX=24
GATEWAY=xx.xx.xx.xx
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no

When I viewed the NetworkManager GUI it showed one entry called VLAN20 with all of the IPs under the IPv4 Settings tab.
Now, on Host B, I've created the same files, with the same fields. However the NetworkManager GUI doesn't show VLAN20, it shows seven items with the name "System eth0:x" (and no mention of just eth0).
If I use the NetworkManager GUI on host B to mimic the settings on host A, it creates a single ifcfg-VLAN20 file with all of the addresses in, and the secondary interfaces don't show up in ifconfig…

What's happening?

Best Answer

First of all, I think you have too many information (and wrong information) in the ifcfg-eth?:? files:

1) I don't think you need/should specify the GATEWAY in all of them, at least to avoid confusions.

2) BOOTPROTO should probably not exist and even if it should, it has an incorrect value (it can be "none", "bootp" or "dhcp").

3) ONBOOT should never be used for alias interfaces and I've seen a lot of trouble caused by this before. It should always be ONPARENT.

4) I think you should always specify the default gateway in /etc/sysconfig/network rather than interface definitions. But that may probably be a personal opinion without a real proof that it is better, just that it sounds more logical to me.

5) The VLAN20 thing that you see in NetworkManager is there from the NAME option, so specify it in your config files as it may be missing I think.