10

I have a problem in network sharing using SMB protocol. I think it's related to IP-duplicating issue. How to detect this.
Note: I'm using Ubuntu on my desktop the other are using various OSs (win xp, vista, mac, Ubuntu).

4 Answers4

9

You can use arpping command. The arping utility performs an action similar to ping command, but at the Ethernet layer. You can send ARP REQUEST to a neighbor host / computers.

Send ARP request
find out reachability of an IP on the local Ethernet with arping i.e send ARP request 192.168.1.1:

$ sudo arping -I eth0 -c 3 192.168.1.1

Output:

ARPING 192.168.1.1 from 192.168.1.106 ra0
Unicast reply from 192.168.1.1 [00:18:39:6A:C6:8B]  2.232ms
Unicast reply from 192.168.1.1 [00:18:39:6A:C6:8B]  1.952ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)

Where,

  • -I eth0 : Specify network interface i.e. name of network device where to send ARP REQUEST packets. This option is required.
  • -c 3 : Stop after sending 3 ARP REQUEST packets

    Find duplicate IP
    The -D option specifies duplicate address detection mode (DAD). It returns exit status 0, if DAD succeeded i.e. no replies are received.

    $ sudo arping -D -I eth0 -c 2 192.168.1.1
    

    If 192.168.1.1 duplicated you should see zero exit status:

    $ echo $?
    

    Always use following syntax for duplicate address detection with arping:

    $ sudo arping -D -I <interface-name> -c 2 <IP-ADDRESS-TO-TEST>
    $ echo $?
    
  • Jay Wick
    • 6,817
    admintech
    • 7,032
    5

    You can install IPwatchD which works with (other) Debian packages.
    The linked article also explains the method and installation steps.
    IPwatchD source is from sourceforge.

    alt text

    It lets you configure for a GUI notification (as above, only for GNOME) and a 'syslog' message.

    Gareth
    • 19,080
    nik
    • 57,042
    0

    Unfortunately accepted answer does NOT work if the address you are checking is on your machine. This will do:

    arping -0c1 192.168.1.1
    

    It works correctly thanks to -0 option. For scripting you can use arping -q0c1 192.168.1.1 to check address on your machine for duplicates, it returns 0 if there are duplicates. Use arping -qdc1 192.168.1.1 to check address that is NOT on your machine for duplicates, on the contrary, it returns 1 if there are duplicates.

    From man arping:

    • -0 - Use this option to ping with source IP address 0.0.0.0. Use this when you haven’t configured your interface yet. Note that this may get the MAC-ping unanswered.
    • -c count - Only send count requests.
    • -d - Find duplicate replies. Exit with 1 if there are answers from two different MAC addresses.
    • -q - Does not display messages, except error messages.

    You can also increase count to ensure that a response is received even if there are momentary network congestion or failure.

    Alek
    • 125
    -1

    You cannot have two machines on the same network with the same IP address.

    That said, one of the easiest ways to find out which computers have what IP address is to look through the status pages on your router. Typically there will be some kind of DHCP client list which can tell you which computer (usually given by MAC address) has what IP. One note though, if you are using DHCP, you likely do not have an IP addressing issue. What makes you think you have an IP-duplicating issue?

    heavyd
    • 65,321