Update wireguard
This commit is contained in:
parent
9c9350437e
commit
dec414a98e
2 changed files with 8 additions and 5 deletions
|
@ -52,6 +52,7 @@
|
||||||
|
|
||||||
# Temporary
|
# Temporary
|
||||||
# networking.firewall.allowedTCPPorts = [ 22 ];
|
# networking.firewall.allowedTCPPorts = [ 22 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 51820 ];
|
||||||
|
|
||||||
# Set up the secrets file:
|
# Set up the secrets file:
|
||||||
sops.secrets."wireguard_keys/nixos-rpi4-03" = {
|
sops.secrets."wireguard_keys/nixos-rpi4-03" = {
|
||||||
|
@ -68,16 +69,17 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = {
|
interfaces = {
|
||||||
"wireguard0" = {
|
"wireguard0" = {
|
||||||
ips = [ "10.100.0.2/32" ];
|
ips = [ "10.100.0.2/24" ];
|
||||||
|
listenPort = 51820;
|
||||||
privateKeyFile = "/run/secrets/wireguard_keys/nixos-rpi4-03";
|
privateKeyFile = "/run/secrets/wireguard_keys/nixos-rpi4-03";
|
||||||
# Testing
|
# Testing
|
||||||
peers = [
|
peers = [
|
||||||
{ # osaka-vultr-01
|
{ # osaka-vultr-01
|
||||||
publicKey = "yPZ3EmmIqCkReXf1DRTxzVaKQ2k+ifGmYJHji5nnMmE=";
|
publicKey = "yPZ3EmmIqCkReXf1DRTxzVaKQ2k+ifGmYJHji5nnMmE=";
|
||||||
|
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
|
||||||
persistentKeepalive = 5;
|
persistentKeepalive = 5;
|
||||||
allowedIPs = [ "0.0.0.0/0" ];
|
allowedIPs = [ "0.0.0.0/0" ];
|
||||||
endpoint = "64.176.54.57:51820";
|
endpoint = "64.176.54.57:51820";
|
||||||
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,16 +39,17 @@
|
||||||
"wireguard0" = {
|
"wireguard0" = {
|
||||||
ips = [ "10.100.0.1/24" ];
|
ips = [ "10.100.0.1/24" ];
|
||||||
listenPort = 51820;
|
listenPort = 51820;
|
||||||
|
privateKeyFile = "/run/secrets/wireguard_keys/osaka-vultr-01";
|
||||||
|
|
||||||
postSetup = ''${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eno3 -j MASQUERADE'';
|
postSetup = ''${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o eno3 -j MASQUERADE'';
|
||||||
postShutdown = ''${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eno3 -j MASQUERADE'';
|
postShutdown = ''${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.100.0.0/24 -o eno3 -j MASQUERADE'';
|
||||||
privateKeyFile = "/run/secrets/wireguard_keys/osaka-vultr-01";
|
|
||||||
# Testing
|
# Testing
|
||||||
peers = [
|
peers = [
|
||||||
{ # nixos-rpi4-03
|
{ # nixos-rpi4-03
|
||||||
publicKey = "trHvfNtQ7HKMiJjxEXo2Iubq5G6egjx7gHiBlDmJ5Ek=";
|
publicKey = "trHvfNtQ7HKMiJjxEXo2Iubq5G6egjx7gHiBlDmJ5Ek=";
|
||||||
allowedIPs = [ "10.100.0.2/32" ];
|
|
||||||
persistentKeepalive = 5;
|
|
||||||
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
|
presharedKeyFile = "/run/secrets/wireguard_keys/preshared_key";
|
||||||
|
persistentKeepalive = 5;
|
||||||
|
allowedIPs = [ "10.100.0.2/32" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue