问题原文
原帖链接 · user173141 · CC BY-SA 3.0
There is one solaris command to ping all the hosts in the subnet by issuing :
ping -s 255.255.255.255
Is there anything similar to this one in linux ? My intention is to find one mac address as below after pinging all the hosts:
arp -an | grep mac_address
已采纳解答
原帖链接 · user9517 · CC BY-SA 3.0
All you are doing is pinging the broadcast address. The GNU/Linux version of ping requires that you use the -b switch
-b Allow pinging a broadcast address
There doesn't appear to be a direct equivalent of the Solaris -s switch either (it's only pinging every second and gathering stats) but perhaps it's buried in the Linux man pages- well worth a read (as may be the Solais ones ).
I wouldn't go pinging 255.255.255.255 either (it may take a while to complete) I'd use the broadcast address of the network I was connected to.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
