Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-2008, 06:06 AM
dkarthik@gmail.com
 
Posts: n/a
Detecting unused IP addresses in a subnet using ping?

Hello All,

Is there a way to find all the unused IP addresses of a particular
subnet using ping command? If yes, what is the parameter to be passed
to the ping command?

This is for a enterprise intranet.

For example, the subnet is 16.138.189 and I want to find some unused
IP adddresses in this subnet to use.

Thanks & Regards,

Karthik
Reply With Quote
  #2 (permalink)  
Old 07-09-2008, 07:33 AM
Tauno Voipio
 
Posts: n/a
Re: Detecting unused IP addresses in a subnet using ping?

dkarthik@gmail.com wrote:
> Hello All,
>
> Is there a way to find all the unused IP addresses of a particular
> subnet using ping command? If yes, what is the parameter to be passed
> to the ping command?
>
> This is for a enterprise intranet.
>
> For example, the subnet is 16.138.189 and I want to find some unused
> IP adddresses in this subnet to use.
>


The simple response is: DO NOT.

Many hosts, espeially in the current Windows world,
do not respond to pings, so you can tramp on some
quietly lurking host's address.

Ask the network administrator for the addresses,
if this is for a legitimate purpose.

--

Tauno Voipio
tauno voipio (at) iki fi

Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 10:26 AM
Pascal Hambourg
 
Posts: n/a
Re: Detecting unused IP addresses in a subnet using ping?

Hello,

Tauno Voipio a écrit :
> dkarthik@gmail.com wrote:
>
>> Is there a way to find all the unused IP addresses of a particular
>> subnet using ping command?


> The simple response is: DO NOT.
>
> Many hosts, espeially in the current Windows world,
> do not respond to pings


But they do reply to ARP queries which come before the ping request. No
ARP reply -> no host. So you can ping an IP address until you receive a
message "Destination Host Unreachable" indicating that no host on the
network claimed the IP address.

Of course ping is not the best tool for this task. arping would be more
efficient.
Reply With Quote
  #4 (permalink)  
Old 07-10-2008, 01:31 AM
David Schwartz
 
Posts: n/a
Re: Detecting unused IP addresses in a subnet using ping?

On Jul 9, 3:26*am, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
wrote:

> But they do reply to ARP queries which come before the ping request. No
> ARP reply -> no host. So you can ping an IP address until you receive a
> message "Destination Host Unreachable" indicating that no host on the
> network claimed the IP address.
>
> Of course ping is not the best tool for this task. arping would be more
> efficient.


That won't help. The device may simply be unable or unwilling to reply
to ARP requests at that particular time. It might be off, or
rebooting. It may also be an IP address inside a range that is
dynamically assigned.

You cannot detect unused IP addresses by looking at ARP replies.
Unless by "unused" you mean precisely "no response to ARP replies".

Consider a computer that dual boots between two OSes and each has a
different IP address assigned. At least one of those addresses will
appear unused at any given time.

You have to ask the network administrator.

DS
Reply With Quote
  #5 (permalink)  
Old 07-10-2008, 03:13 AM
Dave {Reply Address in.Sig}
 
Posts: n/a
Re: Detecting unused IP addresses in a subnet using ping?

In message
<876ed66d-3716-4327-8c27-3411c37a7906@l64g2000hse.googlegroups.com>, David
Schwartz wrote:

> On Jul 9, 3:26*am, Pascal Hambourg <boite-a-s...@plouf.fr.eu.org>
> wrote:
>
>> But they do reply to ARP queries which come before the ping request. No
>> ARP reply -> no host. So you can ping an IP address until you receive a
>> message "Destination Host Unreachable" indicating that no host on the
>> network claimed the IP address.
>>
>> Of course ping is not the best tool for this task. arping would be more
>> efficient.

>
> That won't help. The device may simply be unable or unwilling to reply
> to ARP requests at that particular time. It might be off, or
> rebooting. It may also be an IP address inside a range that is
> dynamically assigned.
>
> You cannot detect unused IP addresses by looking at ARP replies.
> Unless by "unused" you mean precisely "no response to ARP replies".
>
> Consider a computer that dual boots between two OSes and each has a
> different IP address assigned. At least one of those addresses will
> appear unused at any given time.
>

If it's assigned by DHCP then chances are they'll both get the same one.
You'll find that very often there's a ping to an address as part of the DHCP
transaction when a new address is assigned (as opposed to a refresh) just
to check that there isn't already something out there using it.

> You have to ask the network administrator.
>

This is, of course, the best answer, especially if you happen to want a
spare address for testing something.
--
Dave
mail da ve@llondel.org (without the space)
http://www.llondel.org
So many gadgets, so little time
Reply With Quote
  #6 (permalink)  
Old 07-10-2008, 06:48 AM
David Schwartz
 
Posts: n/a
Re: Detecting unused IP addresses in a subnet using ping?

On Jul 9, 8:13*pm, "Dave {Reply Address in.Sig}" <noon...@llondel.org>
wrote:

> If it's assigned by DHCP then chances are they'll both get the same one.


True. I can think of quite a few reasons they wouldn't get the same
one, but those are all rare.

> You'll find that very often there's a ping to an address as part of the DHCP
> transaction when a new address is assigned (as opposed to a refresh) just
> to check that there isn't already something out there using it.


Right, but we got here because we understand that 'ping' is not a good
test of IP usage.

> > You have to ask the network administrator.


> This is, of course, the best answer, especially if you happen to want a
> spare address for testing something.


Definitely.

In many cases, no response to an ARP query is good enough to find an
IP for short-term testing. It depends on how critical the network is,
of course.

DS
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Linux > Linux Networking


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:28 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109