0

I have been following this method described here:

http://linuxwave.blogspot.com/2010/01/setting-virtual-ip-in-centos.html

To assign a virtual IP to one NIC.

Basically I copied ifcfg-eth0 and makde it ifcfg-eth0:1, set a new device name and IP Address, but the error I get when I do

service network restart

is as such:

Active connection state : activated Active conncetion path : /org/ freedesktop /NetworkManager /ActiveConnection/xx

The actual config for ifcfg-eth0:

DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=static
IPADDR=10.1.10.10
PREFIX=23
GATEWAY=10.1.10.1
DNS1=10.1.10.1
DOMAIN=company.com
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=xyz
HWADDR=AA:BB:CC:DD:EE

Actual config for ifcfg-eth0:1

DEVICE="eth0:1"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE=Ethernet
BOOTPROTO=static
IPADDR=10.1.10.2
PREFIX=23
GATEWAY=10.1.10.11
DNS1=10.1.10.1
DOMAIN=company.com
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0:1"
UUID=xyz
HWADDR=AA:BB:CC:DD:EE

Where xx is a number that increases each time I restart the network. Then only one IP address shows up when I do ifconfig... How do I solve this problem?

The multiple IP is used for creating a virtual host with apache.

Any help greatly appreciated!

  • The secondary IP should have a prefix of 32 and no gateway or dns. It certainly should not have a DEFROUTE=yes either. – David Schwartz Jan 26 '13 at 0:41
  • Same problem, I stripped down ifcfg-eth0:1 to only have: Device, onboot, bootproto, IPaddr, prefix. Still get the same error, and typing ifconfig doesn't show the secondary IP. Does it matter I have the GNOME desktop installed? Is the network manager UI interfering? – Shiroi98 Jan 26 '13 at 0:52
  • 6
    Most likely a Network Manager issue - uninstall it. (I always do) – colealtdelete Jan 26 '13 at 0:58
  • That did the trick! Thanks Cole! I just stopped the NetworkManager: service NetworkManager stop, and chkconfig NetworkManager off, and then did a 'service network restart' and that did the trick. Thanks! – Shiroi98 Jan 26 '13 at 1:02
  • 2
    @Shiroi98: Make sure you have 'network' start to start automatically, otherwise if you reboot you'll have no networking. – David Schwartz Jan 26 '13 at 3:09
0

Alternatively you can also set NM_CONTROLLED="no" instead of stopping NetworkManger service, so you won't have issue on reboots.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.