forked from poz/niksos
chore(wireguard): remove wireguard chmura config
thanks dad for helping me out with it :-) (I'm still angry that you changed my router config without telling me though)
This commit is contained in:
parent
685096d73a
commit
3c0be224ad
1 changed files with 0 additions and 39 deletions
|
@ -1,39 +0,0 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
networking.nat = {
|
||||
enable = true;
|
||||
externalInterface = "enp6s0";
|
||||
internalInterfaces = [ "wg0" ];
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "192.168.15.1/24" ];
|
||||
listenPort = 51820;
|
||||
postSetup = ''
|
||||
${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 192.168.15.0/24 -o enp6s0 -j MASQUERADE
|
||||
'';
|
||||
postShutdown = ''
|
||||
${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 192.168.15.0/24 -o enp6s0 -j MASQUERADE
|
||||
'';
|
||||
|
||||
privateKeyFile = "/home/chmura/.wg/private";
|
||||
|
||||
peers = [
|
||||
{
|
||||
# main laptop
|
||||
publicKey = "y+bdB0CdX6xm4vK2p2+5vQey9gEDphBf8V/DFt1oaC0=";
|
||||
allowedIPs = [ "192.168.15.0/24" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue