garp(8) - Linux man page
Name
garp - check unused IP addresses and automagically assign themSynopsis
garp [-Vhpvv] [-c count] [-i interface] [-t timeout] address[/mask] ...Description
When running garp with the probeonly-option, it will check whether the addresses provided as arguments are unused.
When running garp without the probeonly-option, it will randomly test a "matching" IP address by sending ARP requests. If no reply is returned, it'll assume that the IP address is unused and will assign it to the interface (and afterwards test it again). If a reply is detected it will try another random IP address until a given number attempts or indefinitely.
Options
- -V, --version
- Print version information.
- -h, --help
- Print a one-line help message and exit.
- -p, --probeonly
- Only test to see if an IP address is unused (but don't assign an IP address).
- -q, --quiet
- Shuts up and stays quiet.
- -v, --verbose
- Tell the user what is going on by being verbose.
- -vv, --moreverbose
- Tell the user what is going on by printing lots of ugly debugging information.
Parameters
- -c, --count count
- Specify how many attempts need to be undertaken to assign an unused IP address. The default is 0, which means indefinitely.
- -i, --interface name
- Specify a network interface for which to assign an IP address. The default is eth0.
- -t, --timeout milliseconds
- Specify the timeout to wait for ARP replies in milliseconds. The default timeout is 300 milliseconds.
Arguments
- address
- Address can be either a hostname, a network name, or a plain IP address.
- mask
- The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to 255.255.255.0.
Diagnostics
Normally, exit status is 0 if an unused IP address is found and assigned. The IP address is printed to STDOUT. Exit status is 1 if there is a problem with one of the arguments. Exit status is 2 if there was a problem with the interface and finally exit status is 3 if it couldn't assign an unused IP address after a given number of attempts.There is an exception when using -p or --probeonly, exit status 0 is used to indicate that a given address is unused. Exit status 1 indicates that the IP address is used by another host.
Bugs
Under construction ;)Email bug reports to: <garp@mind.be>
Notes
Using garp is not a fail-proof solution, in certain conditions (mostly misconfigured, congested or broken networks) ARP replies can't be detected and therefor garp wrongly assigns the IP address causing 2 machines to have the same IP address. Resulting in both machines to be unable to use the network normally.This is not a bug or a design-issue, but a result of network-problems.
Another problem will occur when a whole subnet is spread over different ports on some switches. These switches do weird stuff with ARP requests or MAC addresses, which will confuse garp and will fail. Please test toroughly before using garp on a "switched" network.
You might want to consider using a DHCP or RARP as these provide better alternatives. Use garp when you cannot set up a DHCP or RARP server.
Download
Garp can be downloaded from http://mind.be/software/See Also
arp(8), rarp(8), ifconfig(8), route(8)Authors
Ulrik De Bie, <ulrik@mind.be> - design and implementationDag Wieers, <dag@mind.be> - documentation and ideas
Contact us at: <garp@mind.be>
