Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Valentijn Sessink <v@sess.ink>
To: "Marek Küthe" <m-k-mailling-list@mk16.de>, wireguard@lists.zx2c4.com
Subject: Re: AllowedIPs = ::/0 routes IPv4 - on Android?
Date: Tue, 24 Oct 2023 13:13:26 +0200	[thread overview]
Message-ID: <f3f77566-6d78-4746-b458-cab5b2807b50@sess.ink> (raw)
In-Reply-To: <20231024113755.6a786c71@parrot>

Hi Marek,

Do you have any sources for that? AFAIK, ::/0 is a convenient way to 
describe "any IPv6 address".

Still, if you are correct and should ::/0 include IPv4, then the exact 
same setup under Linux operates differently, because here ::/0 only 
routes IPv6, not IPv4. Note the empty result for the ipv4 routing table:

# AllowedIPs = ::/0
v@lnx:~$ ip ro li ta 51820
v@lnx:~$ ip -6 ro li ta 51820
default dev wgip6 metric 1024 pref medium

# AllowedIPs = ::/0, 0.0.0.0/0
v@lnx:~$ ip ro li ta 51820
default dev wgip6 scope link
v@lnx:~$ ip -6 ro li ta 51820
default dev wgip6 metric 1024 pref medium

So the question remains: ::/0 under Android routes all IPv4 traffic to 
the WG interface, while under Linux, it will only route IPv6.
Is this known behaviour?

The wg-quick manpage is ambiguous, saying that "if one of those routes 
is the default route (0.0.0.0/0 or ::/0), then it uses ip-rule(8) to 
handle overriding of the default gateway." No information on routing 
IPv4 or IPv6 differently.

A rephrase could be something like "if one of those routes is 0.0.0.0/0, 
or ::/0, it uses ip-rule(8) to handle overriding the default route for 
IPv4 or IPv6 respectivally."

Best regards,

Valentijn

On 24-10-2023 11:37, Marek Küthe wrote:
> ::/0 does not describe no IPv4 address, but all IP addresses. So when
[...]
> On Tue, 5 Sep 2023 16:04:34 +0200
> Valentijn Sessink <v@sess.ink> wrote:
>> AllowedIPs = ::/0
[...]
>> To my surprise, I found out that this also tries to route IPv4 addresses
>> to the other WG side.
>> Is this a known feature? Android 13, WireGuard for Android
>> v1.0.20230707, (from AOSP).-- 
http://www.openoffice.nl/   Open Office - Linux Office Solutions
Valentijn Sessink  v.sessink@openoffice.nl  +31(0)20-4214059

      parent reply	other threads:[~2023-10-24 11:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 14:04 Valentijn Sessink
2023-10-24  9:37 ` Marek Küthe
2023-10-24 11:08   ` Nico Schottelius
2023-10-24 11:13   ` Valentijn Sessink [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=f3f77566-6d78-4746-b458-cab5b2807b50@sess.ink \
    --to=v@sess.ink \
    --cc=m-k-mailling-list@mk16.de \
    --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).