Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180888 - arping needs alternate setting for some routers
Summary: arping needs alternate setting for some routers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-04 18:29 UTC by Gabriel Devenyi
Modified: 2007-11-01 15:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
arping.sh patch for source address (arping.sh.patch,2.92 KB, patch)
2007-09-24 06:49 UTC, Conway S. Smith
Details | Diff
arping.patch (arping.patch,564 bytes, patch)
2007-11-01 14:58 UTC, Roy Marples (RETIRED)
Details | Diff
arping.patch (arping.patch,777 bytes, patch)
2007-11-01 15:20 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Devenyi 2007-06-04 18:29:21 UTC
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.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2007-07-11 15:10:38 UTC
I think that this is addressed in baselayout-2.0.0_alpha3, but in a different way. Re-open if you disagree.
Comment 2 Gabriel Devenyi 2007-08-20 13:25:41 UTC
Baselayout 2 doesn't have an option to spoof the source IP address of the arping, hence it does not fix this bug.
Comment 3 Conway S. Smith 2007-09-24 06:49:00 UTC
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.
Comment 4 Roy Marples (RETIRED) gentoo-dev 2007-10-30 11:41:38 UTC
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
Comment 5 Gabriel Devenyi 2007-11-01 14:26:12 UTC
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.
Comment 6 Roy Marples (RETIRED) gentoo-dev 2007-11-01 14:58:05 UTC
Created attachment 134894 [details, diff]
arping.patch

Let me know if this patch works
Comment 7 Gabriel Devenyi 2007-11-01 15:09:03 UTC
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...
Comment 8 Roy Marples (RETIRED) gentoo-dev 2007-11-01 15:20:52 UTC
Created attachment 134896 [details, diff]
arping.patch

Don't use -0 when spoofing
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-11-01 15:21:21 UTC
(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.
Comment 10 Gabriel Devenyi 2007-11-01 15:41:12 UTC
See bug #197788
Comment 11 Gabriel Devenyi 2007-11-01 15:51:29 UTC
New arping.patch also works fine, and calls arping2 with no -O, which should be more robust. Thanks again.