Some gateways/routers do not reply to a source address of 0.0.0.0 (probably violating some rule somewhere by doing so). In order for arping to work for these networks, arping must be made to "listen" on a real ip address, this is achieved in arping2 by using.. arping2 -S <source_address> -r -c 1 -i eth0 <gateway_address> according to the manpage -S IP Like -b and -0 but with set source address. Note that this may get the arping2 unanswered if the target does not have routing to the IP. If you don't own the IP you are using, you may need to turn on promiscious mode on the interface (with -p). With this switch you can find out what IP-address a host has without taking an IP-address yourself. Ideally this would work by grabbing the static IP from config_<gateway_address> = ...., but as this can be one of many things, its probably needs a separate config such as arping_spoofaddress = <source_address> This of course would also require arping2, as I don't think arping can do this kind of thing.
I think that this is addressed in baselayout-2.0.0_alpha3, but in a different way. Re-open if you disagree.
Baselayout 2 doesn't have an option to spoof the source IP address of the arping, hence it does not fix this bug.
Created attachment 131746 [details, diff] arping.sh patch for source address Attached is a patch against arping.sh from baselayout-1.12.10-r4 that basically does what Gabriel Devenyi described. I haven't even looked at baselayout-2.0.0*, so I dunno what the current status is with them. @Roy Marples: what's the "different way" baselayout-2.0.0_alpha3 addresses the issue? Re: Gabriel Devenyi > Ideally this would work by grabbing the static IP from > config_<gateway_address> = ...., but as this can be one of many things, its > probably needs a separate config such as > arping_spoofaddress = <source_address> I'm not skilled enough to figure out how to get just the IP from config_<gateway_address>, so my patch uses arping_source_<gateway_address> (or a global arping_source). > This of course would also require arping2, as I don't think arping can do this > kind of thing. arping from iputils-20070202 has a similar option, -s, but it doesn't seem to work for me, gives a "bind: Cannot assign requested address" error. So one thing my patch changes is prefering arping2 over arping if both are installed.
gateways_eth0="1.2.3,4,aa:bb:cc:dd:ee:ff,5.6.7.8" gateways_eth0="1.2.3,4,,5.6.7.8" Will both spoof the ip of 5.6.7.8 if arping2 is installed. Patch added to our svn repo, will be in baselayout-2.0.0_rc6 Thanks
Thanks for implementing this, but it doesn't quite work yet. The "-O" option explicitly tells arping2 to send from 0.0.0.0, and that seems to be inserted twice into the call to arping2, overriding the "-S" command. If we're going to spoof the source, the -O option needs to be dropped from the call.
Created attachment 134894 [details, diff] arping.patch Let me know if this patch works
Patch works, arping2 now correctly spoofs the address, interesting that there is still one "-O" in the call, but its before the -S, this means that either two -O's overrides the -S, or the last used parameter is used. Either way, it works now, thanks. On a sidenote, the configuration config_eth0="dhcp" fallback_eth0="arping" fails out after the dhcp, rather than trying the arping...
Created attachment 134896 [details, diff] arping.patch Don't use -0 when spoofing
(In reply to comment #7) > On a sidenote, the configuration > config_eth0="dhcp" > fallback_eth0="arping" > > fails out after the dhcp, rather than trying the arping... File a new bug for that please.
See bug #197788
New arping.patch also works fine, and calls arping2 with no -O, which should be more robust. Thanks again.