Skip to content

Commit

Permalink
Wireguard still doesn't work for some reason
Browse files Browse the repository at this point in the history
  • Loading branch information
b3nj5m1n committed Oct 14, 2023
1 parent 281b93a commit 450b396
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion nix/nixos/chinstrap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,45 @@
};
};

# systemd.network = {
# enable = true;
# netdevs = {
# "50-wg0" = {
# netdevConfig = {
# Kind = "wireguard";
# Name = "wg0";
# MTUBytes = "1300";
# };
# wireguardConfig = {
# PrivateKeyFile = "/home/admin/.local/share/wireguard/Server.private";
# ListenPort = 30005;
# };
# wireguardPeers = [
# {
# wireguardPeerConfig = {
# PublicKey = "PtMjckiDgt30S4gzk+fdlJiBJUMaUlP+44KN2G8AbXI=";
# AllowedIPs = ["10.0.0.4"];
# };
# }
# ];
# };
# };
# networks.wg0 = {
# matchConfig.Name = "wg0";
# address = ["10.0.0.4/24"];
# networkConfig = {
# IPMasquerade = "ipv4";
# IPForward = true;
# };
# };
# };
# networking.wireguard.enable = true;
networking.wireguard.interfaces = {
wg0 = {
ips = ["10.0.0.0/8"];
listenPort = 30005;

postSetup = ''
preSetup = ''
${pkgs.nftables}/bin/nft add rule nixos-nat post ip saddr 10.0.0.0/8 oif end0 masquerade
'';
postShutdown = ''
Expand Down

0 comments on commit 450b396

Please sign in to comment.