Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: <wireguard@lists.zx2c4.com>
Subject: Force a specific IP for outgoing WG traffic with SNAT?
Date: Fri, 17 Feb 2023 00:07:47 +0500	[thread overview]
Message-ID: <20230217000747.0825b2e9@nvm> (raw)

Hello,

I'm trying to move all my WG communication with peers to a non-primary IP of my server.

It has IPs added like this:

    inet6 2001:db8::ca6c/128 scope global deprecated 
       valid_lft forever preferred_lft 0sec
    inet6 2001:db8::1/128 scope global nodad 
       valid_lft forever preferred_lft forever

What I tried:

  ip6tables -t nat -I POSTROUTING -d 2000::/3 -p udp --dport 51820 -j SNAT --to-source 2001:db8::ca6c

Also tried to filter by --sport, and also briefly without a port filter at all.

This has zero effect, as shown by tcpdump all the WG traffic still originates from 2001:db8::1

Does anyone have an idea why is that? Thanks

-- 
With respect,
Roman

             reply	other threads:[~2023-02-16 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 19:07 Roman Mamedov [this message]
2023-03-17 19:43 ` Ashish SHUKLA
2023-03-17 19:54   ` Roman Mamedov

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=20230217000747.0825b2e9@nvm \
    --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).