Add Wireguard configuration
This commit is contained in:
parent
20b73b364c
commit
c8348b49d8
@ -47,4 +47,28 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable NAT for wireguard
|
||||||
|
networking.nat = {
|
||||||
|
enable = true;
|
||||||
|
externalInterface = "eth0";
|
||||||
|
internalInterfaces = [ "wg0" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Wireguard setup
|
||||||
|
networking.wireguard.interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
ips = [ "10.8.0.1/24" ];
|
||||||
|
listenPort = 1194;
|
||||||
|
privateKeyFile = "/home/coace/.wg/keys/privatekey";
|
||||||
|
peers = [
|
||||||
|
# Fernando
|
||||||
|
{
|
||||||
|
# Placeholder public key
|
||||||
|
publicKey = "XMkTztU2Y8hw6Fu/2o4Gszij+EmNacvFMXuZyHS1n38=";
|
||||||
|
allowedIPs = [ "10.8.0.2/32" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user