Network Binding - arping - wrong source interface

I was using with success Network Binding and arping, since I added a new interface (for Docker) arping use the wrong interface:

32392 ?        Ssl   62:40 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Djava.library.path=/var/lib/openhab2/tmp/lib -Djetty.
29678 ?        S      0:00  \_ arping -w 2 -c 1 -I docker0
29683 ?        S      0:00  \_ arping -w 2 -c 1 -I docker0

How I can set the correct source interface (eth0 and not docker0)


I’m trying this temporary solution…
The “false” arping skip request if it contains the word “docker”





if [[ ${STRING} != *"docker"* ]];then
        exec /usr/bin/arping $STRING

I’ll let you know…

Just by curiosity I had a look to the source code. As far as I understand the source code the binding detects all available network interfaces and uses all of them. It is not possible to configure the network interface that is to be used. I think this is because of one user might want to use all of them while the other one only wants to use one. Doing a query on all the interfaces solves this.

I wanted to do it myself but I didn’t find the time. Thank you :slight_smile:

The problem is in this “full” example…

"A"   S      0:00  \_ arping -w 2 -c 1 -I docker0
"B"   S      0:00  \_ arping -w 2 -c 1 -I eth0

The process “B” end immediately with “ON”, but the process “A” wait the timeout (-w) and overwrites the value. Result … the IP is “OFF”.

If the code will not be changed with the possibility to select the interface, the solution is my “fake arping” /etc/openhab2/

1 Like

Hmm, the trouble is that for any target device, a ping is likely to fail on one interface on any non-trivial network. That wouldn’t usually matter (the other one worked!) but of course this binding takes positive action by design and reports the failure?

I noticed that it doesn’t work properly.
Here a fix…



if [[ ${STRING} != *"docker0"* ]];then
        exec /usr/bin/arping $STRING
        exec /usr/bin/arping ${STRING/docker0/eth0}

where docker0 is the wrong interface and eth0 the right.