Using arping command in ubuntu 12.04

I am configuring a pgpool instance to get a HA of postgresql services. I am following this configuration.

I found a command and I ran it manually in my console:

arping_cmd = 'arping -U $_IP_$ -w 1'

But it doesn't work, then I want to find a similar behaviour because I am on ubuntu 12.04. How can I do that ?

The $_IP_$ variable is replaced by the ip value in the configuration. The main problem is the arping command.

1

3 Answers

When running the arping command in the terminal, I get the following output:

$ arping -U 192.168.13.1 -w -1
arping: device (option -I) is required.
Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination -f : quit on first reply -q : be quiet -b : keep broadcasting, don't go unicast -D : duplicate address detection mode -U : Unsolicited ARP mode, update your neighbours -A : ARP answer mode, update your neighbours -V : print version and exit -c count : how many packets to send -w timeout : how long to wait for a reply -I device : which ethernet device to use -s source : source ip address destination : ask for what ip address

The solution is in the first line after running the command. Use -I and -s to fix your problem. -I specifies the interface to do the arping on and -s is to specify the source your are doing the arping from. It's crappy, I know, but update your command to look like the below:

arping_cmd = 'arping -U $_IP_$ -w 1 -I ethX -s SOURCE_IP'

where ethx is your ethernet and SOURCE_IP is the IP you are going to do the arping from.

Hope this helps, Cheers

I had a similar problem on Fedora:

$ arping 192.168.1.162
arping: Suitable device could not be determined. Please, use option -I.
...

My solution was:

$ arping $ip_addr -I $(ip route get $ip_addr | cut -d\ -f 3 |xargs)

Where ip_addr would contain the IP to be pinged.

To brake it down:

ip route get 192.168.1.162

would return the route and interface used by kernel for the specified ip:

192.168.1.162 dev eth1 src 192.168.1.1

then use:

cut -d\ -f 3

to split the string by delimiter '\ ' (escaped space) and return 3-th substring:

eth1

then use xargs to remove all whitespaces around interface.

Hope it will be helpfull.

I get the same error as the submitter, saying that "-U" is not a valid option:

root@pgpool-2:/var/log# arping -U 192.168.13.1 -w -1
arping: invalid option -- 'U'
ARPing 2.11, by Thomas Habets <>
usage: arping [ -0aAbdDeFpqrRuv ] [ -w <us> ] [ -S <host/ip> ] [ -T <host/ip ] [ -s <MAC> ] [ -t <MAC> ] [ -c <count> ] [ -i <interface> ] <host/ip/MAC | -B>
For complete usage info, use --help or check the manpage.

I'm on Ubuntu 14.04 and there is no mention of "-U" in the manpage:

root@pgpool-2:/var/log# man arping | grep '\-U'
root@pgpool-2:/var/log#

I changed mine to this:

arping_cmd = 'arping -v $_IP_$ -w 1 -c 100'

So basically:

  • -U doesn't exist, so remove it
  • Add -v to get verbose output, which may be helpful
  • Add -c 100 so that it eventually finishes... otherwise it runs forever

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like