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?
192.168.1.1the system on which you are runningping, or another system on the network? Because on my system (kernel 6.9.x),ping -I 127.0.0.1is unable to ping anything except local addresses, which is what I would expect.ping6 -I ::1 fd00::1TheICMPandICMP6protocols differ.4.14. Somehowfd00::1is not being recognized as local. So in in essence, it would be the same asping -6 -I ::1 www.google.com.