Refactor Wireguard to make it use sisko
as server
This commit is contained in:
parent
0d3c1aae46
commit
f05c12545a
29 changed files with 430 additions and 418 deletions
|
@ -1,27 +1,26 @@
|
|||
{
|
||||
config,
|
||||
fleetFlake,
|
||||
vpn,
|
||||
...
|
||||
}: {
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [51820];
|
||||
};
|
||||
networking.firewall.trustedInterfaces = ["wg0"];
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = ["${(import "${fleetFlake}/lib").ips."${config.networking.hostName}"}/32"];
|
||||
listenPort = 51820;
|
||||
imports = [../wireguard-common];
|
||||
|
||||
privateKeyFile = config.age.secrets."${config.networking.hostName}-wireguard-private-key".path;
|
||||
|
||||
peers = [
|
||||
{
|
||||
publicKey = "O9V2PI7+vZm7gGn3f9SaTsJbVe9urf/jZkdXFz/mjVU=";
|
||||
allowedIPs = ["10.100.0.0/24"];
|
||||
endpoint = "mothership.aciceri.dev:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
networking.wireguard.interfaces.wg0 = {
|
||||
ips = ["${vpn.${config.networking.hostName}.ip}/32"];
|
||||
# TODO having two peers like this a good idea? (they are the same host)
|
||||
peers = [
|
||||
{
|
||||
publicKey = vpn.sisko.publicKey; # FIXME hardcoding `sisko` here
|
||||
allowedIPs = ["10.100.0.0/24"];
|
||||
endpoint = "vpn.aciceri.dev:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
{
|
||||
publicKey = vpn.sisko.publicKey; # FIXME hardcoding `sisko` here
|
||||
allowedIPs = ["10.100.0.0/24"];
|
||||
endpoint = "10.1.1.2:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue