0

I was testing something and stumbled on this weird oddity:

Ping using IPv4 and setting the source address to '127.0.0.1' (works):

# ping -I 127.0.0.1 192.168.1.1 PING 192.168.1.1 (192.168.1.1) from 127.0.0.1 : 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.130 ms 

Ping using IPv6 and setting the source address to '::1' (doesn't work):

# ping -I ::1 fd00::1 PING fd00::1(fd00::1) from ::1 : 56 data bytes 

The strange thing is that this used to work, at least on kernels ≤4.13.16. Is there any valid reason for this change in the Linux kernel, or am I missing something?

4
  • Is 192.168.1.1 the system on which you are running ping, or another system on the network? Because on my system (kernel 6.9.x), ping -I 127.0.0.1 is unable to ping anything except local addresses, which is what I would expect. Commented Aug 1, 2024 at 17:25
  • Yes. 192.168.1.1 and fd00::1 are on the same interface and system. You can easily test this with a dummy interface. The problem is only with IPv6, but not on kernels <4.13. Commented Aug 1, 2024 at 18:38
  • Use ping6 -I ::1 fd00::1 The ICMP and ICMP6 protocols differ. Commented Aug 3, 2024 at 4:27
  • I tried your suggestion, but the outcome is the same. It's most definitely a bug in the Linux kernel starting with 4.14. Somehow fd00::1 is not being recognized as local. So in in essence, it would be the same as ping -6 -I ::1 www.google.com. Commented Aug 3, 2024 at 14:24

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.