mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Fix wireguard
This commit is contained in:
parent
ea08e19912
commit
63331ab3f8
2 changed files with 18 additions and 18 deletions
|
|
@ -32,6 +32,8 @@ in {
|
|||
|
||||
mods.server.media.enable = true;
|
||||
|
||||
mods.server.wireguard.enable = true;
|
||||
|
||||
# Use the GRUB 2 boot loader.
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/vda";
|
||||
|
|
|
|||
|
|
@ -23,26 +23,24 @@
|
|||
};
|
||||
|
||||
|
||||
networking = lib.mkIf config.mods.wireguard.enable {
|
||||
firewall = {
|
||||
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
|
||||
};
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.2/24" ];
|
||||
listenPort = 51820;
|
||||
networking.firewall = lib.mkIf config.mods.wireguard.enable {
|
||||
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
|
||||
};
|
||||
networking.wireguard.interfaces = lib.mkIf config.mods.wireguard.enable {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.2/24" ];
|
||||
listenPort = 51820;
|
||||
|
||||
privateKeyFile = "/home/muon/wireguard-keys/private";
|
||||
privateKeyFile = "/home/muon/wireguard-keys/private";
|
||||
|
||||
peers = [
|
||||
{
|
||||
publicKey = "2RF8GmTZwQdzVm2l2piYy6U0qiMU3wSxC7Lt8urAjwA=";
|
||||
allowedIPs = [ "0.0.0.0/0" ];
|
||||
endpoint = "{server ip}:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
peers = [
|
||||
{
|
||||
publicKey = "2RF8GmTZwQdzVm2l2piYy6U0qiMU3wSxC7Lt8urAjwA=";
|
||||
allowedIPs = [ "0.0.0.0/0" ];
|
||||
endpoint = "{server ip}:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue