[Users] Re: ARP entries being ignored (once again)

Aleksandar Ivanisevic aleksandar at ivanisevic.de
Fri Oct 24 03:14:13 EDT 2008


Vitaliy Gusev <vgusev at openvz.org> writes:

> On 22 October 2008 19:05:40 Aleksandar Ivanisevic wrote:
>> Vitaliy Gusev <vgusev at openvz.org> writes:
>> 
>> > On 22 October 2008 12:25:02 Aleksandar Ivanisevic wrote:
>> >> 
>> >> Hi,
>> >> 
>> >> I am having similar problems as described in this thread
>> >> 
>> >> http://www.mail-archive.com/users@openvz.org/msg01546.html
>> >> 
>> >> basically proxy ARP entries for containers disappear from the arp
>> >> cache after some time, but, unfortunately, there is no solution to
>> >> this other than restarting, at least according to that thread.
>> >
>> > Are you sure that device eth0 didn't go down/up ? Down/up commands
>> > clean arp cache and rules, so arp entry for VE will lost. This can
>> > happens when link of the device looses carrier.
>> 
>> Indeed, network went down for some reason. Actually it went up, but I
>> can't see link going down in the syslog.
>> 
>> Oct 22 05:21:45 ovz1 kernel: eth0: link up, 100Mbps, full-duplex, lpa 0x05E1
>
> It is a driver message and driver merely didn't print "link down".
>
> For RedHat you can create /sbin/ifup-local script which will restore arp table.
> This script is called when interface goes up.


Unfortunately, ifup-local is called only when network is manually
restarted, not when the link goes up or down.

For posterity, I have fixed the "problem" by running this from cron,
every 10 minutes or so:


PATH="$PATH:/sbin:/usr/sbin"

arp -vn | grep MP  |cut -d " " -f 1 > /tmp/arps
vzlist -H -o ip  > /tmp/running

for h in $(grep -vf /tmp/arps /tmp/running); do
  dev=$(/sbin/arp -vn | grep $h | awk '{ print $(NF) }')
  logger -t $0  missing ARP entry for $h on dev $dev, adding
  arp -s $h -i eth0 -D $dev pub
done


[...]


-- 
To sto si frustriran, zavidan tko zna na cemu i sto ne vidis dalje od
svoje guzice je tuzno. Da onda barem imas toliko samokontrole da
sutis umjesto da pravis budalu od sebe... izgleda da si prestar da se
promjenis na bolje. - Davor Pasaric, hr.comp.mac



More information about the Users mailing list