From man ping
:
-I interface
interface is either an address, or an interface name. If interface is an address, it sets source address to specified interface address. If interface in an interface name, it sets source interface to specified interface. For IPv6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) is required.
I have set the IPv6 address fddb:fe2a:ab1e::c023/64
on teamed interface team0
.
When I'm trying to ping other IPv6 host which is in the same network without specifying interface it's working fine:
# ping6 fddb:fe2a:ab1e::c021 PING fddb:fe2a:ab1e::c021(fddb:fe2a:ab1e::c021) 56 data bytes 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=1 ttl=64 time=0.508 ms 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=2 ttl=64 time=0.740 ms 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=3 ttl=64 time=0.688 ms
When I'm trying to ping the same machine specyfying interface using -I
option it's also working fine:
# ping6 fddb:fe2a:ab1e::c021 -I team0 PING fddb:fe2a:ab1e::c021(fddb:fe2a:ab1e::c021) from fddb:fe2a:ab1e::c023 team0: 56 data bytes 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=1 ttl=64 time=3.12 ms 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=2 ttl=64 time=0.975 ms 64 bytes from fddb:fe2a:ab1e::c021: icmp_seq=3 ttl=64 time=0.784 ms
But when I'm trying to ping specyfying interface after %
I get this:
# ping6 fddb:fe2a:ab1e::c021%team0 ping: fddb:fe2a:ab1e::c021%team0: Name or service not known
I have CentoOS Linux release 7.5.1804 (Core) with iputils
in version s20160308
.
The question is: why interface option is not working when I'm using %-notation
. Is is deprecated now?