Compare commits
2 commits
d21cf03776
...
a373a0dc20
| Author | SHA1 | Date | |
|---|---|---|---|
| a373a0dc20 | |||
| 2c60a915eb |
1 changed files with 40 additions and 3 deletions
|
|
@ -18,12 +18,48 @@
|
||||||
80
|
80
|
||||||
443
|
443
|
||||||
];
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
51820
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network.networks."30-wan".address = [
|
networking.iproute2.enable = true;
|
||||||
|
systemd.network.config = {
|
||||||
|
routeTables = {
|
||||||
|
vpn = 133;
|
||||||
|
};
|
||||||
|
addRouteTablesToIPRoute2 = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network.networks."30-wan" = {
|
||||||
|
address = [
|
||||||
"2a01:4f8:c013:7fc0::/64"
|
"2a01:4f8:c013:7fc0::/64"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
routingPolicyRules = [
|
||||||
|
{
|
||||||
|
From = "10.64.244.95/32";
|
||||||
|
Table = "vpn";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
From = "fc00:bbbb:bbbb:bb01::1:f45e/128";
|
||||||
|
Table = "vpn";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
User = config.users.users.vpn.uid;
|
||||||
|
Table = "vpn";
|
||||||
|
Family = "both";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.vpn = { };
|
||||||
|
users.users.vpn = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "vpn";
|
||||||
|
uid = 51280;
|
||||||
|
};
|
||||||
|
|
||||||
networking.wireguard = {
|
networking.wireguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
@ -47,6 +83,7 @@
|
||||||
|
|
||||||
listenPort = 51820;
|
listenPort = 51820;
|
||||||
privateKeyFile = config.sops.secrets.wireguardKey.path;
|
privateKeyFile = config.sops.secrets.wireguardKey.path;
|
||||||
|
table = "133";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue