Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Janne Johansson <icepic.dz@gmail.com>
To: Christoph Loesch <wireguard-mail@chil.at>
Cc: wireguard@lists.zx2c4.com
Subject: Re: Source IP selection or multi-home or multi-interface issue - solved with source-based route - was: Re: Wireguard source ip selection issue with multi interfaces
Date: Fri, 21 Oct 2022 15:25:41 +0200	[thread overview]
Message-ID: <CAA6-MF_AKBUPv9KzeUa2XoxR3m2YARuwtME+Vr_q8pg5NWpubQ@mail.gmail.com> (raw)
In-Reply-To: <e460fec5-3c8f-fafc-4a08-e739be1cf5c5@chil.at>

> "How should wireguard know which IP is the correct source IP address?"
>
> I digged into the source code but couldn't find the part where the source-IP is selected for outgoing connections (like a simple ping).
> I am not a developer but would like to try to understand it. Could someone give me a pointer?

I think it is left to the OS and it's tcp stack to pick the ip (and
interface) based on the UDP destination ip and the current routing
table when sending udp packets.

-- 
May the most significant bit of your life be positive.

  reply	other threads:[~2022-10-21 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 13:10 曹煜
2021-11-23 13:52 ` Christoph Loesch
2022-10-19 22:47   ` Source IP selection or multi-home or multi-interface issue - solved with source-based route - was: " Christoph Loesch
2022-10-19 22:56   ` Christoph Loesch
2022-10-21 13:11     ` Christoph Loesch
2022-10-21 13:25       ` Janne Johansson [this message]
2022-10-21 14:12         ` 曹煜

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA6-MF_AKBUPv9KzeUa2XoxR3m2YARuwtME+Vr_q8pg5NWpubQ@mail.gmail.com \
    --to=icepic.dz@gmail.com \
    --cc=wireguard-mail@chil.at \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).