Skip to content

Feature: add linux network namespace support for wireguard#189

Open
suzakuwcx wants to merge 1 commit into
joukewitteveen:masterfrom
suzakuwcx:master
Open

Feature: add linux network namespace support for wireguard#189
suzakuwcx wants to merge 1 commit into
joukewitteveen:masterfrom
suzakuwcx:master

Conversation

@suzakuwcx
Copy link
Copy Markdown

Wireguard document here

So I add a new configure option 'WGNamespace', if exist, the wireguard will be moved into the sub interface

Here is my test environment, built by GNS3, with archlinux qemu vm, base-1 and base-2 are peers

img1

Configure origin
img2

Configure with 'WGNamespace=subnet'
img3

Add a new wireguard configuration 'WGNamespace', if exist, the
wireguard profile will configure in the sub network namespace
@joukewitteveen
Copy link
Copy Markdown
Owner

At first glance this looks excellent, thanks! I'll read up on network namespaces and will come back with a proper review later.

@endreszabo
Copy link
Copy Markdown

this is how I do it with the classic wg-quick tool:

[Interface]
PrivateKey = ...
ListenPort = ...
Table      = off
MTU        = 1400
PostUp     = ip link set atvie0_ntf01_v4 netns s2s
PostUp     = ip netns exec s2s ip -4 addr add 100.64.2.50/30 dev atvie0_ntf01_v4
PostUp     = ip netns exec s2s ip -6 addr add fd4d:4045:e5e9:8c::2/64 dev atvie0_ntf01_v4
PostUp     = ip netns exec s2s ip link set atvie0_ntf01_v4 up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants