For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > May 2006 > when network goes down while pinging....









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author when network goes down while pinging....
manu

2006-05-29, 7:06 pm

hi experts,
i came across this problem..
i have 2 linux systems, and they are connected via NIC's.
from system i used ping command in linux to ping to another system..
everything is working
fine. But if i deactivate the NIC of the destination system while the
source system is still pinging, the command just hangs up.. no error
messages what so ever.. it does not return at all.. how to detect this
type of network disconnection and return an error message to the
user..?

(any suggestion for modifications in the standard ping program would
help me)
thanking u in advance..
Manohar

Nils O. Selåsdal

2006-05-29, 7:06 pm

manu wrote:
> hi experts,
> i came across this problem..
> i have 2 linux systems, and they are connected via NIC's.
> from system i used ping command in linux to ping to another system..
> everything is working
> fine. But if i deactivate the NIC of the destination system while the
> source system is still pinging, the command just hangs up.. no error
> messages what so ever.. it does not return at all.. how to detect this
> type of network disconnection and return an error message to the
> user..?
>
> (any suggestion for modifications in the standard ping program would
> help me)


Have patience. It'll eventually bail out.
Pascal Bourguignon

2006-05-29, 7:06 pm

"manu" <manoharyes@gmail.com> writes:

> hi experts,
> i came across this problem..
> i have 2 linux systems, and they are connected via NIC's.
> from system i used ping command in linux to ping to another system..
> everything is working
> fine. But if i deactivate the NIC of the destination system while the
> source system is still pinging, the command just hangs up.. no error
> messages what so ever.. it does not return at all.. how to detect this
> type of network disconnection and return an error message to the
> user..?



% ping -c 5 -w 10 192.168.1.100

PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 193.238.146.145: icmp_seq=1 Destination Net Unreachable

--- 192.168.1.100 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms



> (any suggestion for modifications in the standard ping program would
> help me)
> thanking u in advance..
> Manohar
>


--
__Pascal Bourguignon__ http://www.informatimago.com/

This universe shipped by weight, not volume. Some expansion may have
occurred during shipment.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com