Can't ping between interfaces on one device on the same network

In this situation, I recommend using the IP address bound the interface you want to send from, rather than the interface itself (for your config).

ping -I <ens5 IP address> <ens7 IP address>

The reason the ping isn't working as expected, is that the resultant IPv4 datagram's destination IP address is that of the interface passed to ping, rather than the given target IP address.

My config:

2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
     link/ether 52:54:00:e0:cc:50 brd ff:ff:ff:ff:ff:ff
     inet 192.168.122.10/24 brd 192.168.122.255 scope global ens5

3: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 
     link/ether 52:54:00:cd:c9:91 brd ff:ff:ff:ff:ff:ff
     inet 192.168.122.20/24 brd 192.168.122.255 scope global ens6
        
     

This looks like it should work, but doesn't:

root@debian:/home/morgan# ping -c 1 -I ens5 192.168.122.20
PING 192.168.122.20 (192.168.122.20) from 192.168.122.10 ens5: 56(84) bytes of data.

--- 192.168.122.20 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 1ms

tcpdump output shows why it isn't working....

The destination IP address is that of the ens5 interface, rather than the expected target IP (192.168.122.20) passed to ping.

18:36:17.982917 IP 192.168.122.10 > 192.168.122.10: ICMP host 192.168.122.20 unreachable, length 92

When I use the IP address of ens5, the ping works:

root@debian:/home/morgan# ping -c 1 -I 192.168.122.10 192.168.122.20                                                                                                   
PING 192.168.122.20 (192.168.122.20) from 192.168.122.10 : 56(84) bytes of data.                                                                                       
64 bytes from 192.168.122.20: icmp_seq=1 ttl=64 time=5.17 ms                                                                                                           
                                                                                                                                                                   
--- 192.168.122.20 ping statistics ---                                                                                                                                 
1 packets transmitted, 1 received, 0% packet loss, time 2ms                                                                                                            
rtt min/avg/max/mdev = 5.165/5.165/5.165/0.000 ms