On my Debian 8 `uname -a' gives:

Linux uname 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux


route -n gives:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    1024   0        0 eth0   U     0      0        0 eth0     U     1000   0        0 eth0

Other networing functions are fine.

How can I get ping to work? I suspect it is the following !lo rule in iptables but I do no know how to fix it and make the changes persistent.

3591 2197K ACCEPT     all  --  !lo    any     anywhere             anywhere            

This line appears as: -A INPUT ! -i lo -j ACCEPT in /etc/iptables.up.rules

Do I delete the !?

  • Please post the results for ifconfig (without -a). – Luciano Andress Martini Sep 29 '16 at 12:20
  • ifconfig lists lo and eth0 as expected. Do you want me to include it as it is now as I do not believe it contains any value? – skvery Sep 29 '16 at 20:20
  • No its fine. But maybe you need to include this: iptables -t filter -L – Luciano Andress Martini Sep 30 '16 at 14:22

No, Jessie didn't block by default.

ping -c 4
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.050 ms
64 bytes from icmp_seq=2 ttl=64 time=0.056 ms
64 bytes from icmp_seq=3 ttl=64 time=0.054 ms
64 bytes from icmp_seq=4 ttl=64 time=0.044 ms

--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.044/0.051/0.056/0.004 ms

Show iptables -L and cat /etc/hosts cat /etc/hostname

  • The offending line in iptables -L includes the !lo listed above. I am not sure how it was changed if your version is the same? – skvery Sep 29 '16 at 20:15
  • uname -a 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux I never changed iptables rules iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination – user192526 Sep 29 '16 at 20:56
  • I have no idea where the bang Lo rule on my system came from. Thanks for pointing this out. – skvery Sep 30 '16 at 6:07

It appears that Debian 8 iptables denied loopback access on localhost in my installation.

Many programs requires this to function correctly, such as debuggers, so I do not understand how it was disabled in my setup.

The fix is as follows:

Root edit /etc/iptables.up.rules and change -A INPUT ! -i lo -j ACCEPT to -A INPUT -i lo -j ACCEPT by deleting the bang!

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.