if the network interface is disconnected:
ping 8.8.8.8
connect: Network is unreachable
terminates nicely
kernel is sending a specific signal to the
ping and thus ping is shutting itself down.
But if network interface is up and
I am blocking all traffic via iptables..
vi /etc/sysconfig/iptables
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A OUTPUT -j REJECT --reject-with icmp-net-unreachable
-A INPUT -j DROP
-A FORWARD -j DROP
COMMIT
but it will not make ping shut off. and stop.
ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.0.100 icmp_seq=1 Destination Net Unreachable
From 192.168.0.100 icmp_seq=1 Destination Net Unreachable
From 192.168.0.100 icmp_seq=1 Destination Net Unreachable
it simply keeps on continuing.
I have tried other --reject-with flags
such as:
icmp-net-unreachable
icmp-host-unreachable
icmp-port-unreachable
icmp-proto-unreachable
icmp-net-prohibited
icmp-host-prohibited
icmp-admin-prohibited
none of them can make ping quit.
What I want to see is ping terminate the same way
it terminates when network interface is disconnected.
if this can not be done via iptables..
is there a command I can run to send ping the same
signal the kernel sends .. to tell it "network interface is not connected" ?
( it would be a lie but I want it to shut itself off basically )