LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-02-2006, 11:49 AM   #1
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Rep: Reputation: 0
quick ping - possible?


Maybe it would fit in Newbie forum...

When I ping a host and host is available - I receive an answer within no time.
When the host is not available - it lasts about 5 second before I get an answer.
I need to scan my LAN to know who is online. So 5 seconds per host is too much.
Is there some quick and durty way to do it?

Last edited by APRESTOUS; 05-02-2006 at 11:50 AM.
 
Old 05-02-2006, 11:55 AM   #2
carambar
LQ Newbie
 
Registered: Dec 2005
Location: Swindon, UK
Distribution: Debian
Posts: 26

Rep: Reputation: 15
I seem to remember that you can use the -w parameter with the ping command to set a timeout value (in milliseconds), so you might want to try using that.
 
Old 05-02-2006, 12:00 PM   #3
sarin
Member
 
Registered: May 2001
Location: India, Kerala, Thrissur
Distribution: FC 7-10
Posts: 354
Blog Entries: 2

Rep: Reputation: 34
Try ping -b <bcast> for a few seconds and then filter the data. This may not always give you all the hosts. Also you may try -W option (ping -c 1 -W 1 <ip>).
 
Old 05-02-2006, 12:13 PM   #4
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by carambar
I seem to remember that you can use the -w parameter with the ping command to set a timeout value (in milliseconds), so you might want to try using that.
Thank you, very nice. I use -w 1 and it is decreased to 1 second. Is 1 second the minimum?
When I try to use -w 0.1 - it doesn't work.
 
Old 05-02-2006, 12:22 PM   #5
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,498
Blog Entries: 2

Rep: Reputation: 68
Quote:
Originally Posted by APRESTOUS
I need to scan my LAN to know who is online. So 5 seconds per host is too much.
Try fping. It is good to pinging several hosts with a single command and it has controls to limit the number of pings in each hosts and time (e.g. fping -B 1 -c 1)
 
Old 05-02-2006, 12:54 PM   #6
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks! fping looks the best solution.
ALready installed and testing :-))
 
Old 05-03-2006, 03:29 AM   #7
APRESTOUS
LQ Newbie
 
Registered: Sep 2004
Location: the Netherlands
Distribution: Fedora 2 & Mandrake 9.1
Posts: 15

Original Poster
Rep: Reputation: 0
Impressions:

It begins very fast. Run through all hosts. But then it begins the second run and it takes a lot more time.
And I do not see how I can avoid it.

I use now fping -a -B 1 -r 1 -g 192.168.1.1 192.168.1.90 -s -t 1
 
Old 05-03-2006, 07:50 AM   #8
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,498
Blog Entries: 2

Rep: Reputation: 68
I am sorry, but here, I replay your command changing only the net range, and I can't tell there is a significative difference between consecutive runs.

Code:
# time fping -a -B 1 -r 1 -g 192.168.155.150 192.168.155.200 -s -t 1
--output cuted ---
      51 targets
       1 alive
      50 unreachable
       0 unknown addresses

     100 timeouts (waiting for response)
     101 ICMP Echos sent
       1 ICMP Echo Replies received
      84 other ICMP received

 0.52 ms (min round trip time)
 0.52 ms (avg round trip time)
 0.52 ms (max round trip time)
        4.489 sec (elapsed real time)


real    0m4.492s
user    0m0.000s
sys     0m0.000s
# time fping -a -B 1 -r 1 -g 192.168.155.150 192.168.155.200 -s -t 1
--output cuted ---
      51 targets
       1 alive
      50 unreachable
       0 unknown addresses

     100 timeouts (waiting for response)
     101 ICMP Echos sent
       1 ICMP Echo Replies received
      80 other ICMP received

 0.20 ms (min round trip time)
 0.20 ms (avg round trip time)
 0.20 ms (max round trip time)
        4.397 sec (elapsed real time)

real    0m4.403s
user    0m0.000s
sys     0m0.000s
# time fping -a -B 1 -r 1 -g 192.168.155.150 192.168.155.200 -s -t 1
--output cuted ---
      51 targets
       1 alive
      50 unreachable
       0 unknown addresses

     100 timeouts (waiting for response)
     101 ICMP Echos sent
       1 ICMP Echo Replies received
      84 other ICMP received

 0.59 ms (min round trip time)
 0.59 ms (avg round trip time)
 0.59 ms (max round trip time)
        4.487 sec (elapsed real time)


real    0m4.492s
user    0m0.004s
sys     0m0.000s
#
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 03:39 PM
LAN/ADSL Router ping working but DNS ping fails R N Ghosh Linux - Networking 1 01-13-2006 08:44 AM
Any idea why this time I can not ping my LAN pc but can PING for ex. www.yahoo.com vakia Debian 5 09-28-2005 07:42 PM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 10:10 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration