Skip to content

VTimofeenko/wg-namespace-flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flake that provides a NixOS module which creates a network namespace and moves a WireGuard adapter to that namespace. Whatever process is launched in that namespace should egress only through the adapter.

To illustrate:

(user) $ curl ifconfig.co
X.X.X.X
(user) $ firejail --noprofile --netns=vpn sh
sh-5.1$ curl ifconfig.co
Y.Y.Y.Y

Usage

  1. Configure a WireGuard adapter, e.g. using systemd-networkd.

  2. Add this flake to your inputs;

    inputs = {.
      wg-namespace-flake = {
        url = "github:VTimofeenko/wg-namespace-flake";
      };
    }
  3. Import the default module from this flake and configure it:

      # Namespace config
      services.wireguard-namespace = {
        enable = true;
        namespaceName = "vpn";
        interfaceName = "nameOfTheVPNAdapter";
      };
  4. Make sure the [email protected] is started

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published