Change vps wireguard port
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{ config, inputs, ... }:
|
{ config, inputs, ... }:
|
||||||
let
|
let
|
||||||
jupiterConfig = inputs.self.nixosConfigurations.jupiter.config;
|
jupiterConfig = inputs.self.nixosConfigurations.jupiter.config;
|
||||||
wireguardPort = 51820;
|
wireguardPort = 51821;
|
||||||
jupiterPublicIPv4 = "51.89.210.124";
|
jupiterPublicIPv4 = "51.89.210.124";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@@ -10,7 +10,7 @@ in
|
|||||||
"net.ipv4.conf.all.proxy_arp" = 1;
|
"net.ipv4.conf.all.proxy_arp" = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets.wireguard = { };
|
sops.secrets."wireguard/server" = { };
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall = {
|
firewall = {
|
||||||
@@ -22,7 +22,7 @@ in
|
|||||||
ips = [ "10.0.0.1/24" ];
|
ips = [ "10.0.0.1/24" ];
|
||||||
listenPort = wireguardPort;
|
listenPort = wireguardPort;
|
||||||
|
|
||||||
privateKeyFile = config.sops.secrets.wireguard.path;
|
privateKeyFile = config.sops.secrets."wireguard/server".path;
|
||||||
|
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{
|
||||||
|
@@ -11,11 +11,9 @@ let
|
|||||||
jupiterPublicIPv4 = "51.89.210.124";
|
jupiterPublicIPv4 = "51.89.210.124";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sops.secrets.wireguard = { };
|
sops.secrets."wireguard/client/vps" = { };
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
firewall.allowedUDPPorts = [ wireguardPort ];
|
|
||||||
|
|
||||||
iproute2 = {
|
iproute2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
rttablesExtraConfig = ''
|
rttablesExtraConfig = ''
|
||||||
@@ -33,7 +31,7 @@ in
|
|||||||
"${jupiterPublicIPv4}/32"
|
"${jupiterPublicIPv4}/32"
|
||||||
];
|
];
|
||||||
|
|
||||||
privateKeyFile = config.sops.secrets.wireguard.path;
|
privateKeyFile = config.sops.secrets."wireguard/client/vps".path;
|
||||||
|
|
||||||
table = "wireguard";
|
table = "wireguard";
|
||||||
postSetup = [ "${ip} rule add from ${jupiterPublicIPv4} table ${table}" ];
|
postSetup = [ "${ip} rule add from ${jupiterPublicIPv4} table ${table}" ];
|
||||||
|
Reference in New Issue
Block a user