Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Matthias Urlichs <matthias@urlichs.de>
To: wireguard@lists.zx2c4.com
Subject: Re: match on wg packets and redirect
Date: Sun, 4 Nov 2018 14:56:26 +0100	[thread overview]
Message-ID: <03a8d637-e365-9767-61cd-66de09485b7e@urlichs.de> (raw)
In-Reply-To: <6b75dc4f-f519-6841-133e-98dbbdb5e862@gmail.com>

On 04.11.18 14:46, Adrian Sevcenco wrote:
> so, i would like to redirect (in raw/prerouting) the incoming wg
> packets from 443 to actual wg listening port

Simply set your WG listening port to 443.

There's nothing else that sends UDP packets to port 443, so why would
you need to match anything?

If you really want to use two ports,

iptables -t nat -I PREROUTING -p udp --dport 443 -i
YOUR_EXTERNAL_INTERFACE -d YOUR_PUBLIC_IP -j REDIRECT --to-ports
YOUR_REAL_WG_PORT

should work. Or you could set up a separate WG interface.

-- 
-- Matthias Urlichs

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2018-11-04 13:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04  9:09 Adrian Sevcenco
2018-11-04  9:55 ` Matthias Urlichs
2018-11-04 11:41 ` Kalin KOZHUHAROV
2018-11-04 13:46   ` Adrian Sevcenco
2018-11-04 13:56     ` Matthias Urlichs [this message]
2018-11-04 15:14 ` Jason A. Donenfeld
2018-11-04 15:29   ` Jason A. Donenfeld
2018-11-05 14:22 Saeid Akbari

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=03a8d637-e365-9767-61cd-66de09485b7e@urlichs.de \
    --to=matthias@urlichs.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).