Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

network scanning

Hari Prasad S R
Frequent Advisor

network scanning

Hi guys,

is there any tool to scan network for free ipaddress in a particular range of ipaddress in hpux 11.00
7 REPLIES
Mel Burslan
Honored Contributor

Re: network scanning

Well this is not a tool but you can use this ping approach.

determine the decimal numbers for the start & end address of the range you want to scan as follows

IP address=a.b.c.d

decimal representation
(a*256*256*256)+(b*256*256)+(c*256)+d
[do this for bots start and end of your range ip addresses]

START_ADDR=
END_ADDR=

IP=${START_ADDR}
while [ ${IP} -le ${END_ADDR} ]
do
loss=`ping ${IP} -c 3 |grep "packets transmitted"| cut -d, -f3| cut -d% -f1|cut -d" " -f2`
if [ ${loss} -eq 100 ]
then
echo ${IP} >> /tmp/avaiable_IPs
else
echo ${IP} >> /tmp/inuse_IPs
fi
let IP=$IP+1
done

when you are done, you will have the IP addresses in decimal form in the
/tmp/avaiable_IPs file. You need to do the IP address conversion in the reverse manner to determine the addresses in a.b.c.d form

Keep in mind that, an IP address not responding at one time does not necessarily mean that it is available guaranteed. The workstation with that IP address may have an owner who failed to turn on the computer at the time you did the scan. So, if I were you I would do this scan at different times of the day for a couple of weeks and combine all the output at the end for a better chance of getting it right.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: network scanning

sorry there was a typo in the script

the correct version of the following ping statement should be as follows:

loss=`ping ${IP} -n 3 |grep "packets transmitted"| cut -d, -f3| cut -d% -f1|cut -d" " -f2`

the packet count is is -n not -c as I have put it down on my posting above. And although it broke down into two lines, it actually is on a single line.

________________________________
UNIX because I majored in cryptology...
Bill Hassell
Honored Contributor

Re: network scanning

This is not a good idea to locate a free address (ping to find unresponsive addresses). If a particular printer or computer is offline, the ping will fail and if you use that address, your system will be clobbered when the printer or computer is turned back on. This is an ideal solution for a DHCP server. Otherwise, you'll need to create a spreadsheet of machines and IP addresses and make sure no one violates the rules about getting an official IP address.


Bill Hassell, sysadmin
Hari Prasad S R
Frequent Advisor

Re: network scanning

Hi Bill,

I tryed your ping script but i am getting a problem for the starting ipaddress itself i have calculated for the ipaddress (32.85.128.230) and i got 542474470 this itself it is giving error as

ping[7]: [542474470: not found

thanks
Yogeeraj_1
Honored Contributor

Re: network scanning

hi,

you may try to run the free windows-based utility called "Angry IP scanner"

http://www.securizare4u.go.ro/download/ipscan.exe

hope this helps!
regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Hari Prasad S R
Frequent Advisor

Re: network scanning

Hi yogeeraj,

Actually i have set of static ips assigned to unix workstations(which includes sun solaris and HP -UX), in that how to find assigned ipaddress.
i am looking for a tool where it should tell me what are used ips with platforms.

thanks
RAC_1
Honored Contributor

Re: network scanning

Pinging range ip address is not a good idea as Bill pointed. Yuo can do the same thing by pinging the broadcast address on the network. That will ping all ip addresses on that network.

But the correct procedure, should be contacting your network administrator and ask him for free ip address.

Anil
There is no substitute to HARDWORK