I am not able to ping localhost

  ashish@ashishk:~$ ping localhost
    PING localhost ( 56(84) bytes of data.
    --- localhost ping statistics ---
    16 packets transmitted, 0 received, 100% packet loss, time 15003ms

Here is my host file :

ashish@ashishk:~/chef-repo/.chef$ cat /etc/hosts   localhost    ashishk.example.com chef

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
  • Can you ping
    – Jos
    Aug 26 '15 at 15:06
  • No. Can't ping also Aug 26 '15 at 15:14

Got solution :

ashish@ashishk:~/chef-repo/.chef$ vim /etc/sysctl.conf

# Ignore Directed pings
net.ipv4.icmp_echo_ignore_all = 1

made it 0 it worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.