linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Source address selection for ICMP error message
@ 2019-08-06  5:32 Chun Wang
  0 siblings, 0 replies; only message in thread
From: Chun Wang @ 2019-08-06  5:32 UTC (permalink / raw)
  To: linux-kernel

Hi all

I've got 2 units network:

+----------------------+
|                      |
|vlan23:172.16.23.2/24 |
+----------------------+
           |
           |
           |
+----------------------+
|VRF lo1               |
|vlan20: 172.16.20.1/24|
|vlan21: 172.16.21.1/24|
|vlan22: 172.16.22.1/24|
|vlan23: 172.16.23.1/24|
|vlan24: 172.16.24.1/24|
|                      |
|                      |
+----------------------+

Interface vlan20,vlan21,vlan22,vlan23 and vlan24 are enslaved in VRF on
one of the unit.

#ip route show vrf lo1
172.16.20.0/24 dev vlan20 proto kernel scope link src 172.16.20.1 
172.16.21.0/24 dev vlan21 proto kernel scope link src 172.16.21.1 
172.16.22.0/24 dev vlan22 proto kernel scope link src 172.16.22.1 
172.16.23.0/24 dev vlan23 proto kernel scope link src 172.16.23.1 
172.16.24.0/24 dev vlan24 proto kernel scope link src 172.16.24.1 

When I ping 172.16.22.4 and 2.2.2.2 from 172.16.23.2. The source
address of the icmp error is 172.16.20.1, not 172.16.23.1 which I
expected. 

#ping 172.16.24.5     
PING 172.16.24.5 (172.16.24.5) 56(84) bytes of data.
From 172.16.20.1 icmp_seq=1 Destination Host Unreachable   
From 172.16.20.1 icmp_seq=2 Destination Host Unreachable
From 172.16.20.1 icmp_seq=3 Destination Host Unreachable
From 172.16.20.1 icmp_seq=4 Destination Host Unreachable
From 172.16.20.1 icmp_seq=5 Destination Host Unreachable

#ping 2.2.2.2         
PING 2.2.2.2 (2.2.2.2) 56(84) bytes of data.
From 172.16.20.1 icmp_seq=1 Destination Net Unreachable
From 172.16.20.1 icmp_seq=2 Destination Net Unreachable
From 172.16.20.1 icmp_seq=3 Destination Net Unreachable
From 172.16.20.1 icmp_seq=4 Destination Net Unreachable

The units have linux version 4.4.6 and
"sysctl_icmp_errors_use_inbound_ifaddr" is set to 1(this is required
and I have no intention to change this). 

Is the source address selection in this case correct? Will the latest
inux version return 172.16.23.1 instead of 172.16.20.1 in this case? If
not, what's the best way to solve this?

I haven't subscribed to this list yet, please CC me the
answers/comments. 

Thanks for your help,
Chun

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-06  5:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06  5:32 Source address selection for ICMP error message Chun Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).