All of lore.kernel.org
 help / color / mirror / Atom feed
* how udp source address gets selected when default gateway is configured with multipath-routing
@ 2019-11-22  6:37 Mohan R
  2019-12-08 17:34 ` David Ahern
  0 siblings, 1 reply; 2+ messages in thread
From: Mohan R @ 2019-11-22  6:37 UTC (permalink / raw)
  To: netdev

Hi,

I have a simple multipath-routing setup,

default
        nexthop via 192.168.15.1 dev enp4s0 weight 1
        nexthop via 10.0.1.1 dev wlp2s0 weight 1
10.0.1.0/24 dev wlp2s0 proto kernel scope link src 10.0.1.251
10.0.3.0/24 dev wlp0s29u1u2 proto kernel scope link src 10.0.3.1
10.3.1.0/24 dev wg9000 proto kernel scope link src 10.3.1.2
192.168.0.0/16 dev enp4s0 proto kernel scope link src 192.168.15.251

here enp4s0 (192.168.0.0/16) and wlp2s0 (10.0.1.0/24) are connected to
two different ISPs.

DNS works fine when I access internet through my internal subnet
(10.0.3.0/24), but  when I try 'ping google.com' in this machine, the
DNS request to 1.1.1.1 (which is my nameserver in resolv.conf) to
resolve 'google.com' is sent through enp4s0 interface but the source
address in that DNS request contains 10.0.1.251 (wlp2s0's local ip
address).

If I have single nexthop in default route, everything works fine.

How can I make sure that kernel picks the correct source ip for the dns request?

Thanks,
Mohan R

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how udp source address gets selected when default gateway is configured with multipath-routing
  2019-11-22  6:37 how udp source address gets selected when default gateway is configured with multipath-routing Mohan R
@ 2019-12-08 17:34 ` David Ahern
  0 siblings, 0 replies; 2+ messages in thread
From: David Ahern @ 2019-12-08 17:34 UTC (permalink / raw)
  To: Mohan R, netdev

On 11/21/19 11:37 PM, Mohan R wrote:
> Hi,
> 
> I have a simple multipath-routing setup,
> 
> default
>         nexthop via 192.168.15.1 dev enp4s0 weight 1
>         nexthop via 10.0.1.1 dev wlp2s0 weight 1
> 10.0.1.0/24 dev wlp2s0 proto kernel scope link src 10.0.1.251
> 10.0.3.0/24 dev wlp0s29u1u2 proto kernel scope link src 10.0.3.1
> 10.3.1.0/24 dev wg9000 proto kernel scope link src 10.3.1.2
> 192.168.0.0/16 dev enp4s0 proto kernel scope link src 192.168.15.251
> 
> here enp4s0 (192.168.0.0/16) and wlp2s0 (10.0.1.0/24) are connected to
> two different ISPs.
> 
> DNS works fine when I access internet through my internal subnet
> (10.0.3.0/24), but  when I try 'ping google.com' in this machine, the
> DNS request to 1.1.1.1 (which is my nameserver in resolv.conf) to
> resolve 'google.com' is sent through enp4s0 interface but the source
> address in that DNS request contains 10.0.1.251 (wlp2s0's local ip
> address).
> 
> If I have single nexthop in default route, everything works fine.
> 
> How can I make sure that kernel picks the correct source ip for the dns request?
> 

This is a known problem. A route lookup is done to set the source
address and then a second lookup is done to route the packet. The
lookups will have different hash values (since saddr == 0 in the first)
and can land on different legs of the multipath route.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-08 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22  6:37 how udp source address gets selected when default gateway is configured with multipath-routing Mohan R
2019-12-08 17:34 ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.