Development discussion of WireGuard
 help / color / mirror / Atom feed
From: 曹煜 <cao88yu@gmail.com>
To: Janne Johansson <icepic.dz@gmail.com>
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 22:12:58 +0800	[thread overview]
Message-ID: <CACu-5+1_7MC5qxw86azNipP5WJwEz003wPEaz2mmY1Gqs9Y2xw@mail.gmail.com> (raw)
In-Reply-To: <CAA6-MF_AKBUPv9KzeUa2XoxR3m2YARuwtME+Vr_q8pg5NWpubQ@mail.gmail.com>

Hi,
Actually, I've hacked the wireguard source code by myself months ago,
and it's working as expected on openwrt with mwan3.
See details and the last hack patch on my github issue:
https://github.com/openwrt/packages/issues/9538
As I said on the issue, the problem is wireguard always reset the
incoming ip and ipmark, and then select the source ip from main
routing table.

Janne Johansson <icepic.dz@gmail.com> 于2022年10月21日周五 21:27写道:
>
> > "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 14:16 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
2022-10-21 14:12         ` 曹煜 [this message]

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=CACu-5+1_7MC5qxw86azNipP5WJwEz003wPEaz2mmY1Gqs9Y2xw@mail.gmail.com \
    --to=cao88yu@gmail.com \
    --cc=icepic.dz@gmail.com \
    --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).