[SOLVED] Can't Ping localhost

Kernels, Network, and Services configuration
Post Reply
Message
Author
TribalBob
Posts: 4
Joined: 2014-05-08 02:41

[SOLVED] Can't Ping localhost

#1 Post by TribalBob »

Hello all!

Just installed Debian 7 about a week ago and I thought everything was fine until today...

It seems that my box is not handling loopback/localhost requests... I am able to SSH into the box and I can access the internet from the box, but I am unable to ping localhost.

I have been searching for an answer on Google for more than 6 hours now using the terms "debian 7 can't ping localhost", "debian 7 loopback not working", "debian 7 can't configure loopback" and various other search terms, I have found some relevant threads, but no solutions.

When I run "ifconfig lo" I get:

Code: Select all

lo        Link encap: Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 aadr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:609 errors:0 dropped:0 overruns:0 frame:0
          TX packets:609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:49323 (48.1 KiB)  TX bytes:49323 (48.1 KiB)
when I run "ping localhost" it just hangs and I have to ctrl+c, the output I get:

Code: Select all

PING localhost (127.0.0.1) 56(84) bytes of data.
^C
--- localhost ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 9999ms
I've run "ifconfig lo 127.0.0.1" followed by "route add 127.0.0.1" and after the second command I get:

Code: Select all

SIOCADDRT: No such device
My /etc/network/interfaces file is as follows:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# My WiFi Device
auto wlan0
iface wlan0 inet static
          wpa-ssid MyNetworkName
          wpa-psk MyNetworkPassword
          address 192.168.1.101
          netmask 255.255.255.0
          network 192.168.1.0
          broadcast 192.168.1.255
          gateway 192.168.1.1
Running "cat /proc/sys/net/ipv4/icmp_echo_ignore_all" returns "0".

My /etc/hosts file looks like this:

Code: Select all

127.0.0.1        localhost
127.0.1.1        server.home        server

# The following lines are desirable for IPv6 capable hosts
::1        localhost ip6-localhost ip6-loopback
ff02::1  ip6-allnodes
ff02::2  ip6-allrouters
My "/etc/resolv.conf" file is as follows:

Code: Select all

domain localdomain
search localdomain
nameserver 192.168.1.1
I am completely at a loss here, any help would be greatly appreciated, thank you!
Last edited by TribalBob on 2014-05-08 04:13, edited 1 time in total.

TribalBob
Posts: 4
Joined: 2014-05-08 02:41

Re: Can't Ping localhost

#2 Post by TribalBob »

Problem solved.

I forgot to allow loopback traffic in my iptables... Wow, I feel silly...

User avatar
dasein
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Can't Ping localhost

#3 Post by dasein »

You'd save folks time and trouble if you'd mark your thread as SOLVED. (Lets folks know that no further attention is needed.)

P.S. Welcome to the forums.

TribalBob
Posts: 4
Joined: 2014-05-08 02:41

Re: Can't Ping localhost

#4 Post by TribalBob »

dasein wrote:You'd save folks time and trouble if you'd mark your thread as SOLVED. (Lets folks know that no further attention is needed.)

P.S. Welcome to the forums.
I was looking for a way to do that but did not see any, do I just edit the post and add "SOLVED" to the title or is there a specific way to do this...? Thanks!

User avatar
dasein
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Can't Ping localhost

#5 Post by dasein »

That's exactly what you do. Edit the subject line of your initial post.

TribalBob
Posts: 4
Joined: 2014-05-08 02:41

Re: Can't Ping localhost

#6 Post by TribalBob »

dasein wrote:That's exactly what you do. Edit the subject line of your initial post.
Got it, thanks m8!

Post Reply