Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get ucarp working on 2 Centos 6 servers running Apache. I've configured both /etc/sysconfig/carp/vip-001.conf and /etc/sysconfig/network-scripts/eth0 and eth0:0 as such on serv1:

vip-001.conf :

# Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
# $Id$

# Set the same password on all mamchines sharing the same virtual IP

# You are required to have an IPADDR= line in the configuration file for
# this interface (so no DHCP allowed)

# Do *NOT* use a main interface for the virtual IP, use an ethX:Y alias
# with the corresponding /etc/sysconfig/network-scripts/ifcfg-ethX:Y file
# already configured and ith ONBOOT=no

# If you have extra options to add, see "ucarp --help" output
# (the lower the "-k <val>" the higher priority and "-P" to become master ASAP)
   OPTIONS="-k 128 -P"

eth0 :


eth0:0 :


Serv2 is basicaly the same with the little modifications dues to its IP. But i can't manage to launch ucarp (ucarp start), and i keep on getting the error :

[ERROR] You must supply a valid virtual host id

Anyone has any idea of how to fix this ? Thanks in advance !

EDIT 1 : Okay, after some tests, it seems ucarp doesn't use the vip-001.conf file I configured. When I try to launch it by configuring using the command line : ucarp start --vhid=1 It asks for a password (which i guess i can set using the --password option). So... Where do I set which files it uses ? I went through /etc/init.d/carp but it's seems just fine, and I haven't modified it so...

EDIT 2 : I Keep on getting "no IPADDR found in interface file ifcfg-eth0:" errors while trying to launch ucarp via sh -x /etc/init.d/carp start. I can't figure out how to fix it...

share|improve this question
cat /etc/init.d/carp? – quanta May 6 '13 at 8:12
It should be, but I haven't modified it so I don't see why it wouldn't work ? I went through it and everything seems fine... – PaKempf May 6 '13 at 8:31
And it seems starting ucarp using "/etc/init.d/carp start" doesn't work either, but it just fails without giving any info. – PaKempf May 6 '13 at 8:44
sh -x /etc/init.d/carp start? – quanta May 6 '13 at 8:50
Here is the full return : – PaKempf May 6 '13 at 9:22
up vote 0 down vote accepted

I found the problem.

Pay attention to the line 55 in the init script:

BIND_ADDRESS="`ifconfig ${BIND_INTERFACE} | sed -n 's/.*inet addr:\([^ ]*\) .*/\1/p' | head -n 1`"

This is trying to get the IP address from the ifconfig eth0 output. In the English language, it works fine because ifconfig eth0 returns something like:

eth0      Link encap:Ethernet  HWaddr C6:9B:8E:AF:A7:69  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::c49b:8eff:feaf:a769/64 Scope:Link


# ifconfig eth0 | sed -n 's/.*inet addr:\([^ ]*\) .*/\1/p' | head -n 1

But in your language (French?), ifconfig eth0 returns:

eth0      Link encap:Ethernet  HWaddr 00:15:5D:09:16:0E
          inet adr:  Bcast:  Masque:
          adr inet6: fe80::215:5dff:fe09:160e/64 Scope:Lien

Notice that it is "inet adr" instead of "inet addr", so the ifconfig eth0 | sed -n 's/.*inet addr:\([^ ]*\) .*/\1/p' | head -n 1 returns nothing. This is reason why you get no IPADDR found in interface file ifcfg-eth0: when starting UCARP.

The fix is open the init script and change the line 55 to:

BIND_ADDRESS="`ifconfig ${BIND_INTERFACE} | sed -n 's/.*inet adr:\([^ ]*\) .*/\1/p' | head -n 1`"

(just delete a "d" character)

or the simpler way is get the value of $IPADDR from the /etc/sysconfig/network-scripts/ifcfg-eth0:

share|improve this answer
You, sir, just made my day. Thanks for the fix, it worked like a charm !! :D – PaKempf May 6 '13 at 15:49

In vip-001.conf etc. you don't set ID in the file, it comes from the filename. Delete that line starting with ID.

Serv2 should also have a slightly different k value in the .conf file to set the priority.

share|improve this answer
I've deleted the ID=001 line but it still doesn't start, same error. (K value sonr serv2 is modified too). Also, the error comes with "Using [eth0] as a network interface". Shouldn't it be [Eth0:0] ? – PaKempf May 6 '13 at 7:17
I've added some info in the original post. – PaKempf May 6 '13 at 7:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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