Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: wireguard@lists.zx2c4.com
Subject: Reconciling "cryptokey-based" and regular routing
Date: Fri, 16 Mar 2018 22:01:11 +0500	[thread overview]
Message-ID: <20180316220111.594ee06f@natsu> (raw)

Hello,

I need to have multiple gateways on my WG network that can provide access to
the entire IPv4 (or IPv6) Internet, for redundancy and load-balancing
purposes.

In WG terms this means I need to set AllowedIPs to 0.0.0.0/0 on more than one
peer. Then I would add routes into the regular routing table for various
destinations,

ip -4 route add 8.8.8.8 via 10.0.0.1
ip -4 route add 8.8.4.4 via 10.0.0.2

or

ip -4 route add default \
  nexthop via 10.0.0.1 weight 1 \
  nexthop via 10.0.0.2 weight 1

or whatever.

But as documentation and some testing show, this can't really work in WG's
"cryptokey-routing" system. If multiple hosts have 0.0.0.0/0 as allowed IPs,
WG just sends everything to a random one of them (the first one?),
disregarding all of the routing table settings from the examples above.

Is there any possibility to still use multiple routers like that?

If not, then could you add an option to not use AllowedIPs for routing?
Or at least to not enforce filtering on incoming packets -- then perhaps I
could have only 10.0.0.1 and 10.0.0.2 in AllowedIPs for those hosts, and
outgoing routing would work properly, with replies from Internet hosts not
getting filtered out?

(Apologies for multiple posts per day, I'm just deploying WireGuard for the
first time today, and it's quite unusual compared to what I used before. I
will stop soon :)

-- 
With respect,
Roman

             reply	other threads:[~2018-03-16 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 17:01 Roman Mamedov [this message]
2018-03-16 17:22 ` Tim Sedlmeyer
2018-03-16 17:35 ` Aaron Jones

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=20180316220111.594ee06f@natsu \
    --to=rm@romanrm.net \
    --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).