Bring up a virtual interface without checking if it's up elsewhere

5,754

Solution 1

You should be able to do this within the confines of Red Hat's network scripts. However, you can't due to a bug in those scripts.


This is how I would have gone about it:

First, suppress ARP completely while the interface is being brought up. Then re-enable it after the interface is up. (You must re-enable ARP or the machine will not be able to communicate at all.)

To suppress ARP during interface initialization, add to /etc/sysconfig/network-scripts/ifcfg-eth0. This actually disables ARP at the kernel level, which should make any attempts to use arping fail.

ARP=no

To re-enable ARP after the interface is up, create a file /sbin/ifup-local with the necessary commands:

#!/bin/bash
ip link set dev $1 arp on

However, this fails, precisely because it causes arping to fail. Since the /etc/sysconfig/network-scripts/ifup-eth script doesn't actually check the return code from arping carefully enough, if you actually set ARP=no then the initialization fails with an incorrect error message claiming the IP address is already in use.


This leaves you with your original option, that recommended by the vendor: Hack the script, and (optionally) report the bug to Red Hat.

Solution 2

I know this is old but I was looking this up today

You can add ARPCHECK=no to any interface definition file to skip the check.

Only tested in CentOS 6.7

Solution 3

You don't have to use the ifup scripts at all. You could just use ifconfig?

The problem is that you're likely to have one requirement after another of things that you want to happen when you raise or lower the interface, and then you'll be reinventing the ifup system.

I'm not currently working with redhat systems, so I'm not well placed to poke around the scripts you're talking about. I'd have thought tough that it wouldn't be too bad to maintain some variations in the ifup scripts, and it's the right place to describe what the behaviour you want is. For the sort of environment you're talking about you should be running configuration management software anyway. (puppet, chef, or similar). So making sure your changes don't get lost in upgrades shouldn't be too hard.

Share:
5,754
Josh Smeaton
Author by

Josh Smeaton

Updated on September 18, 2022

Comments

  • Josh Smeaton
    Josh Smeaton over 1 year

    Is there a way to bring up a virtual interface without it first sending an arping to check if that IP address is already in use elsewhere?

    I'm working with a proprietary product that recommends copying the ifup script and commenting out the arping check section. But then that custom version of the ifup script needs to be stored somewhere, and it's not the nicest thing to maintain.

    Is there a better way of bringing up the interface without the arping check?

  • Josh Smeaton
    Josh Smeaton almost 11 years
    The applications are for routing/streaming RTP traffic in a call center. The control server, during a primary/backup failover, sends an up message to the new primary and a down message to the old primary. If these arrive out-of-order, the switchover fails, and thousands of calls drop because they no longer have a RTP server to connect to.
  • Josh Smeaton
    Josh Smeaton almost 11 years
    What I was hoping for was something like: ifup eth0:1 --force