wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Tim Schumacher <tim@tschumacher.net>
To: wireguard@lists.zx2c4.com
Subject: wg-quick's Ethernet unplug problem
Date: Wed, 17 Nov 2021 21:49:52 +0100	[thread overview]
Message-ID: <fbb34b62-8227-6106-2101-f7f1398b2143@tschumacher.net> (raw)


there is this annoying problem with the way wg-quick sets up the 
routing, that when you unplug the Ethernet cable the routing rule (see 
ip rule) that checks the fwmark gets lost. So let's say you move to 
another location with your laptop and plug in an Ethernet cable again, 
it essentially disables your VPN. You're lucky if you have the popular 
kill switch in place blocking all your traffic instead of silently 
disabling your VPN.

PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i 
fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i 
fwmark) -m addrtype ! --dst-type LOCAL -j REJECT

I have no idea why the rule gets lost. It might be the kernel removing 
it for whatever reason. But it makes no sense to me because I don't see 
how the kernel would make a connection between that rule and the 
Ethernet link that goes down. Any ideas on the issue? Is this a known 
problem? Are there workarounds?


             reply	other threads:[~2021-11-18 17:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 20:49 Tim Schumacher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-06 12:40 wg-quick's Ethernet unplug problem Tim Schumacher

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:

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

  git send-email \
    --in-reply-to=fbb34b62-8227-6106-2101-f7f1398b2143@tschumacher.net \
    --to=tim@tschumacher.net \
    --cc=wireguard@lists.zx2c4.com \


* 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).