Skip to content

Instantly share code, notes, and snippets.

@asymmetric
Last active April 14, 2019 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asymmetric/e711a8ebce0f3cba7dde7ea3d85aa0a9 to your computer and use it in GitHub Desktop.
Save asymmetric/e711a8ebce0f3cba7dde7ea3d85aa0a9 to your computer and use it in GitHub Desktop.
wireguard
wireguard.interfaces.wg0 = {
ips = [ "10.100.0.2/24" ];
privateKeyFile = "/home/asymmetric/wireguard-keys/private";
peers = [
{
publicKey = "xPjzdx0RA9RuAR0HFA+VCLOglgeKKqVyTa3FXDX6Ejs=";
allowedIPs = [ "10.100.0.1/32" ];
endpoint = "159.69.55.136:51820";
persistentKeepalive = 25;
}
];
};
networking.nat = {
enable = true;
externalInterface = "ens3";
internalInterfaces = [ "wg0" ];
};
networking.wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.1/24" ];
listenPort = 51820;
privateKeyFile = "/root/wireguard-private-key";
peers = [
{
# asymmetric@tachikoma
publicKey = "gTqmM3TXHUAunBn59SJdKs9sDn0pMaPXdaFJXO3wxQM=";
allowedIPs = [ "10.100.0.2/32" ];
}
];
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment