ping -c 1 -W 500 192.168.1.254 | awk '/time=/{split($7,T,"="); if (T[2]<=0 ) T[2]=0 ; print T[2]}'
ping -c 1 192.168.1.18
PING 192.168.1.18 (192.168.1.18): 56 data bytes
64 bytes from 192.168.1.18: icmp_seq=0 ttl=30 time=2.032 ms
--- 192.168.1.18 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 2.032/2.032/2.032/0.000 ms
ping -c 1 192.168.1.254
PING 192.168.1.254 (192.168.1.254): 56 data bytes
--- 192.168.1.254 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
Или сделайте интерфейс-петлю, свяжите мостом с нужным интерфейсом и читайте с него pcap'ом, при необходимости шлите.