Update wireguard link

This commit is contained in:
iFargle 2024-01-12 17:23:27 +09:00
parent e3cd22141c
commit d8e5475667
2 changed files with 10 additions and 10 deletions

View file

@ -9,11 +9,11 @@
networking.firewall.interfaces.wireguard0.allowedTCPPorts = [ 22 ];
# Set up the secrets file:
sops.secrets."wireguard_keys/framework-server" = {
sops.secrets."wireguard_key" = {
owner = "root";
sopsFile = ../../../secrets/wireguard.yaml;
sopsFile = ../../../secrets/hosts/framework-server.yaml;
};
sops.secrets."wireguard_keys/preshared_key" = {
sops.secrets."preshared_key" = {
owner = "root";
sopsFile = ../../../secrets/wireguard.yaml;
};
@ -26,12 +26,12 @@
"wireguard0" = {
ips = [ "10.100.0.2/24" ];
listenPort = 51820;
privateKeyFile = "/run/secrets/wireguard_keys/framework-server";
privateKeyFile = "/run/secrets/wireguard_key";
# Testing
peers = [
{ # osaka-linode-01
publicKey = "yPZ3EmmIqCkReXf1DRTxzVaKQ2k+ifGmYJHji5nnMmE=";
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
presharedKeyFile = "/run/secrets/preshared_key";
persistentKeepalive = 5;
allowedIPs = [ "10.100.0.1/32" ];
endpoint = "172.234.84.222:51820"; # osaka-linode-01

View file

@ -15,12 +15,12 @@
networking.firewall.interfaces.wireguard0.allowedTCPPorts = [ 22 ];
# Set up the secrets file:
sops.secrets."wireguard_keys/osaka-linode-01" = {
sops.secrets."wireguard_key" = {
owner = "root";
sopsFile = ../../../secrets/wireguard.yaml;
sopsFile = ../../../secrets/hosts/osaka-linode-01.yaml;
};
sops.secrets."wireguard_keys/preshared_key" = {
sops.secrets."preshared_key" = {
owner = "root";
sopsFile = ../../../secrets/wireguard.yaml;
};
@ -38,13 +38,13 @@
"wireguard0" = {
ips = [ "10.100.0.1/24" ];
listenPort = 51820;
privateKeyFile = "/run/secrets/wireguard_keys/osaka-linode-01";
privateKeyFile = "/run/secrets/wireguard_key";
postSetup = ''${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o enp0s4 -j MASQUERADE'';
postShutdown = ''${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o enp0s4 -j MASQUERADE'';
peers = [
{ # nixos-rpi4-03
publicKey = "trHvfNtQ7HKMiJjxEXo2Iubq5G6egjx7gHiBlDmJ5Ek=";
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
presharedKeyFile = "/run/secrets/preshared_key";
persistentKeepalive = 5;
allowedIPs = [ "10.100.0.2/32" ];
}