1

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?

1 Answer 1

1

A scope ID specification is not required, and doesn't make sense, for IPv6 addresses which aren't link-local addresses. You are pinging a routable address, not a link-local address, therefore you do not need to, and should not, provide a scope ID. RFC 4007 states that:

The format applies to all kinds of unicast and multicast addresses of non-global scope except the unspecified address, which does not have a scope. The format is meaningless and should not be used for global addresses.

(Note that in 2005 when this was written, IPv6 had more scopes, some of which have since been changed or deprecated. Today this effectively applies only to link-local addresses.)

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.