Comment 1 for bug 1877158

Revision history for this message
Victor Tapia (vtapia) wrote :

I forgot to mention that this happens from 2.6 up to 2.8. I'm attaching a patch for 2.8 that returns the expected results:

ubuntu@final:~$ ip r
default via 192.168.122.1 dev ens4 proto static
10.0.1.0/24 dev ens7 proto kernel scope link src 10.0.1.254
192.168.122.0/24 dev ens4 proto kernel scope link src 192.168.122.227

ubuntu@final:~$ ip r show table 1
default via 10.0.1.1 dev ens7 proto static
10.0.2.0/24 via 10.0.1.2 dev ens7 proto static

ubuntu@final:~$ ip rule
0: from all lookup local
0: from 10.0.1.0/24 to 10.0.1.0/24 lookup main
100: from 10.0.1.0/24 lookup 1
100: from all to 10.0.2.0/24 lookup 1
32766: from all lookup main
32767: from all lookup default

ubuntu@final:~$ ping 10.0.2.1 -c1
PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data.
64 bytes from 10.0.2.1: icmp_seq=1 ttl=63 time=1.89 ms

--- 10.0.2.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.895/1.895/1.895/0.000 ms

ubuntu@final:~$ ping -I 10.0.1.254 10.0.2.1 -c1
PING 10.0.2.1 (10.0.2.1) from 10.0.1.254 : 56(84) bytes of data.
64 bytes from 10.0.2.1: icmp_seq=1 ttl=63 time=1.43 ms

--- 10.0.2.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.439/1.439/1.439/0.000 ms

ubuntu@final:~$ traceroute -n 10.0.2.1
traceroute to 10.0.2.1 (10.0.2.1), 30 hops max, 60 byte packets
 1 10.0.1.2 0.521 ms 0.471 ms 0.436 ms
 2 10.0.2.1 1.460 ms 1.435 ms 1.395 ms