Why "ping6 -I <Interface_name>" is not working in RHEL 7 system?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL 7)
  • IPv6

Issue

  • ping6 is able to ping via an interface, even if the interface is not having IPv6 address assigned/configured
  • ping6 is picking other interfaces when specified particular interface using "-I" option when the IPv6 IP is not configured on it.
  • ping6 -I <interface_name> was working in RHEL6 but not with RHEL7.

Resolution

  • This issue has been resolved with the release of RHEL 7.4 and with the upgraded version of iputils package and with the release of the iputils-20160308-10.el7 package as RHBA-2017:1987

  • Please upgrade the iputils package to at least iputils-20160308-10.el7

Root Cause

Diagnostic Steps

  • IPv6 address configured on ens9 interface and not on the ens10
4: ens9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
      link/ether 00:00:00-00:00:aa brd ff:ff:ff:ff:ff:ff
      inet 10.0.1.1/24 brd 10.0.0.255 scope global dynamic ens9
       valid_lft 3054sec preferred_lft 3054sec
    inet6 2001:xxxx:xxxx:xx::6/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link 
       valid_lft forever preferred_lft forever
5: ens10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
       link/ether 00:00:00-00:00:bb brd ff:ff:ff:ff:ff:ff
       inet 10.0.0.1/24 brd 10.0.0.255 scope global ens10
       valid_lft forever preferred_lft forever
    inet 10.0.2.3/24 brd 10.0.2.255 scope global ens10
       valid_lft forever preferred_lft forever
  • When specifying the interface which is not having IPv6 address, ping6 is still working as it is picking the other interface (ens9) which is having IPv6 address
# ping6 -I ens10 2001:xxxx:xxxx:xx::4
PING 2001:xxxx:xxxx:xx::4(2001:xxxx:xxxx:xx::4) 56 data bytes
64 bytes from 2001:xxxx:xxxx:xx::4: icmp_seq=1 ttl=64 time=1.35 ms
64 bytes from 2001:xxxx:xxxx:xx::4: icmp_seq=2 ttl=64 time=1.30 ms
^C
--- 2001:xxxx:xxxx:xx::4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.308/1.329/1.351/0.042 ms
  • Once the system is upgraded to iputils-20160308-10.el7, the ping6 is failing if the IPv6 address is not configured or is disabled on the interface
# rpm -qa | grep -i iputils
iputils-20160308-10.el7.x86_64

# ping6 -I ens10 2001:xxxx:xxxx:xx::4
ping6: Warning: source address might be selected on device other than ens10.
PING 2001:xxxx:xxxx:xx::4(2001:xxxx:xxxx:xx::4) from 2001:xxxx:xxxx:xx::6 ens10: 56 data bytes
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
^C
--- 2001:xxxx:xxxx:xx::4 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments