You are not logged in.

#1 2023-03-09 09:26:15

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

[SOLVED] can't ping 127.0.0.1

➜  ~ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3052ms


➜  ~ ping -c2 -W1 192.168.1.27
PING 192.168.1.27 (192.168.1.27) 56(84) bytes of data.

--- 192.168.1.27 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1010ms


1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:8e:3e:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.27/24 brd 192.168.1.255 scope global noprefixroute enp3s0
       valid_lft forever preferred_lft forever
3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff


➜  ~ ping -c4 -W1 192.168.1.80
PING 192.168.1.80 (192.168.1.80) 56(84) bytes of data.
64 bytes from 192.168.1.80: icmp_seq=1 ttl=64 time=0.182 ms
64 bytes from 192.168.1.80: icmp_seq=2 ttl=64 time=0.180 ms
64 bytes from 192.168.1.80: icmp_seq=3 ttl=64 time=0.197 ms
64 bytes from 192.168.1.80: icmp_seq=4 ttl=64 time=0.179 ms

--- 192.168.1.80 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3039ms
rtt min/avg/max/mdev = 0.179/0.184/0.197/0.007 ms

Last edited by sevk (2023-03-13 08:52:12)

Offline

#2 2023-03-09 11:23:09

Grigorios
Member
Registered: 2021-01-10
Posts: 27

Re: [SOLVED] can't ping 127.0.0.1

Post your output from

 $ip a s lo 

.

Probably your loopback device is not configured correctly.

EDIT: Forgot to add the "s" switch, thanks seth.

Last edited by Grigorios (2023-03-13 09:20:16)

Offline

#3 2023-03-09 12:07:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Re: [SOLVED] can't ping 127.0.0.1

That'll only get you "Command "lo" is unknown"

Also the OP wrote:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:8e:3e:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.27/24 brd 192.168.1.255 scope global noprefixroute enp3s0
       valid_lft forever preferred_lft forever
3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff

There's also no response on the LAN IP, => firewall?

Offline

#4 2023-03-10 00:31:15

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

➜  ~ systemctl| grep -E "ipt|ufw|wall|fire"
  UNIT                                                                                                                  LOAD   ACTIVE SUB       DESCRIPTION
  systemd-ask-password-wall.path                                                                                        loaded active waiting   Forward Password Requests to Wall Directory Watch
  iptables.service                                                                                                      loaded active exited    IPv4 Packet Filtering Framework
➜  ~ sudo systemctl stop iptables.service 
➜  ~ sudo systemctl disable iptables.service
Removed "/etc/systemd/system/multi-user.target.wants/iptables.service".
➜  ~ sudo systemctl status iptables.service 
○ iptables.service - IPv4 Packet Filtering Framework
     Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; preset: disabled)
     Active: inactive (dead)

➜  ~ ping -c2 -W1  127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

--- 127.0.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1025ms






seth wrote:

That'll only get you "Command "lo" is unknown"

Also the OP wrote:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:8e:3e:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.27/24 brd 192.168.1.255 scope global noprefixroute enp3s0
       valid_lft forever preferred_lft forever
3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff

There's also no response on the LAN IP, => firewall?

Last edited by sevk (2023-03-13 08:45:42)

Offline

#5 2023-03-10 01:14:58

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

➜  ~ ip -a -s -h a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    RX:  bytes packets errors dropped  missed   mcast           
         25.5k     271      0       0       0       0 
    TX:  bytes packets errors dropped carrier collsns           
         25.5k     271      0       0       0       0 
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:1b:0d:8e:3e:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.27/24 brd 192.168.1.255 scope global noprefixroute enp3s0
       valid_lft forever preferred_lft forever
    RX:  bytes packets errors dropped  missed   mcast           
         19.0G   28.0M      0     477       0   1.17M 
    TX:  bytes packets errors dropped carrier collsns           
         1.83G   11.4M      0       0       0       0 
3: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
    RX:  bytes packets errors dropped  missed   mcast           
             0       0      0       0       0       0 
    TX:  bytes packets errors dropped carrier collsns           
             0       0      0       0       0       0 


➜  ~ ifconfig lo     
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 271  bytes 25489 (24.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 271  bytes 25489 (24.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Grigorios wrote:

Post your output from

 $ip a lo 

.

Probably your loopback device is not configured correctly.

Last edited by sevk (2023-03-10 02:06:47)

Offline

#6 2023-03-10 07:01:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Re: [SOLVED] can't ping 127.0.0.1

Please don't top-post.

➜  ~ sudo systemctl stop iptables.service
➜  ~ sudo systemctl disable iptables.service

This will not void any exisiting entries, https://wiki.archlinux.org/title/Iptabl … mmand_line

Offline

#7 2023-03-13 00:56:18

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

➜  ~ cat 1.sh

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw -X
iptables -t security -F
iptables -t security -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

sudo iptables -nvL 

ping -c2 -W1 127.0.0.1 
ping -c2 -W1 192.168.1.27 
ping -c2 -W1 192.168.1.80

➜  ~ sudo sh 1.sh
iptables v1.8.9 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `raw': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `raw': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `security': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.8.9 (legacy): can't initialize iptables table `security': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.

--- 127.0.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1004ms

PING 192.168.1.27 (192.168.1.27) 56(84) bytes of data.

--- 192.168.1.27 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1023ms

PING 192.168.1.80 (192.168.1.80) 56(84) bytes of data.
64 bytes from 192.168.1.80: icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from 192.168.1.80: icmp_seq=2 ttl=64 time=0.154 ms

--- 192.168.1.80 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1023ms
rtt min/avg/max/mdev = 0.154/0.163/0.172/0.009 ms

Last edited by sevk (2023-03-13 08:06:45)

Offline

#8 2023-03-13 07:02:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Re: [SOLVED] can't ping 127.0.0.1

seth wrote:

Please don't top-post.

https://en.wikipedia.org/wiki/Posting_style#Top-posting
You doN't have to quote every nonsense at all.

This is getting into the territory where you or whoever maintains this system deliberately counteracted this:

sudo sysctl -a | grep -i icmp

Offline

#9 2023-03-13 07:49:50

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

➜  ~ sudo sysctl -a | grep -i icmp
net.ipv4.icmp_echo_enable_probe = 0
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_errors_use_inbound_ifaddr = 0
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.icmp_msgs_burst = 50
net.ipv4.icmp_msgs_per_sec = 1000
net.ipv4.icmp_ratelimit = 1000
net.ipv4.icmp_ratemask = 6168
net.netfilter.nf_conntrack_icmp_timeout = 30
net.netfilter.nf_conntrack_icmpv6_timeout = 30

➜  ~ cat /etc/sysctl.conf
net.ipv4.tcp_rfc1337=1

Last edited by sevk (2023-03-13 08:03:20)

Offline

#10 2023-03-13 07:59:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Re: [SOLVED] can't ping 127.0.0.1

The answer is obvious and in your last post, but unless you go over *all* your posts and remove the fucking top-post quotes, you'll have to figure it yourself.

Offline

#11 2023-03-13 08:02:57

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

top-post quotes has deleted

Offline

#12 2023-03-13 08:15:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Re: [SOLVED] can't ping 127.0.0.1

Well, mostly. But I'll acknowledge the effort.

net.ipv4.icmp_echo_ignore_all = 1

This is not the default value and explains why you're not getting icmp echos from the system.
Settig it to "0" will immediately allow you to ping the system.

sudo sysctl net.ipv4.icmp_echo_ignore_all=0

Doesn't explain where it's coming from, but looking at /etc/sysctl.d/* will be a good idea.

Edit: typos, sysctl command

Last edited by seth (2023-03-13 08:17:33)

Offline

#13 2023-03-13 08:25:14

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

➜  sysctl.d ls -al
total 16
drwxr-xr-x   2 root root  4096 Apr  9  2018 .
drwxr-xr-x 143 root root 12288 Mar 13 15:49 ..
➜  sysctl.d sudo sysctl net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_all = 0
➜  sysctl.d ping 127.0.0.1                                                                                       
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.032 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1013ms
rtt min/avg/max/mdev = 0.028/0.030/0.032/0.002 ms

Last edited by sevk (2023-03-13 08:46:04)

Offline

#14 2023-03-13 08:29:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,354

Offline

#15 2023-03-13 08:47:02

sevk
Member
From: CN
Registered: 2017-02-09
Posts: 37

Re: [SOLVED] can't ping 127.0.0.1

thanks

Offline

Board footer

Powered by FluxBB