1

Pi3 with static IP assigned to eth0 (192.168.0.164). Pinging loopback interface from eth0 using

ping -I eth0 -c 1 127.0.0.1

fails. However,

ping -I 192.168.0.164 -c 1 127.0.0.1

works. I cannot understand this.

1

Very Odd, But Normal?

I replicated this behavior on my RPi2B, which has a static address (192.168.1.111) on its eth0.


Oddly, ping -I 192.168.1.111 -c 1 127.0.0.1 doesn't generate any icmp traffic on eth0; it only generates traffic on the local loopback:

pi@raspberry:~ $ sudo tcpdump -i lo -v
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
21:06:25.756416 IP (tos 0x0, ttl 64, id 26787, offset 0, flags [DF], proto ICMP (1), length 84)
    raspberry > localhost: ICMP echo request, id 6771, seq 1, length 64
21:06:25.757333 IP (tos 0x0, ttl 64, id 52634, offset 0, flags [none], proto ICMP (1), length 84)
    localhost > raspberry: ICMP echo reply, id 6771, seq 1, length 64

On the other hand, ping -I eth0 -c 1 127.0.0.1 doesn't generate any traffic on the local loopback; it just sends out anicmp message from eth0 and doesn't get any icmp messages back:

pi@raspberry:~ $ sudo tcpdump -i eth0 icmp -v
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
21:06:00.740117 IP (tos 0x0, ttl 64, id 25587, offset 0, flags [DF], proto ICMP (1), length 84)
    raspberry > localhost: ICMP echo request, id 6733, seq 1, length 64

The networking wizards over at serverfault might have more insight on this behavior.

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.