1
0
Fork 0

gatekeeper: Remove host from overlay network

This commit is contained in:
clerie 2022-09-28 20:07:14 +02:00
parent c456f09dbf
commit d54c8a6853
1 changed files with 1 additions and 143 deletions

View File

@ -15,15 +15,6 @@
networking.hostName = "gatekeeper";
networking.useDHCP = false;
# Local Router IPs
networking.interfaces.lo.ipv6.addresses = [
{ address = "fd00:152:152:101::1"; prefixLength = 64; }
{ address = "fd00:152:152::1"; prefixLength = 128; } # Anycast
];
networking.interfaces.lo.ipv4.addresses = [
{ address = "10.152.101.1"; prefixLength = 24; }
{ address = "10.152.0.1"; prefixLength = 32; } # Anycast
];
# Network
networking.interfaces.ens3.ipv4.addresses = [ { address = "78.47.183.82"; prefixLength = 32; } ];
networking.interfaces.ens3.ipv6.addresses = [ { address = "2a01:4f8:c0c:15f1::1"; prefixLength = 64; } ];
@ -40,50 +31,6 @@
networking.wireguard.enable = true;
networking.wireguard.interfaces = {
wg-carbon4 = {
ips = [ "fe80::127:1/64" "169.254.127.1/24" ];
peers = [ {
allowedIPs = [ "0.0.0.0/0" "::/0" ];
publicKey = "5EVyQC0y704asO4SwsGbAoFGKusuO4a6IJ2bS/5bcTI=";
} ];
listenPort = 50127;
allowedIPsAsRoutes = false;
privateKeyFile = "/var/src/secrets/wireguard/wg-carbon4";
};
wg-porter6 = {
ips = [ "fe80::101:1/64" "169.254.101.1/24" ];
peers = [ {
allowedIPs = [ "0.0.0.0/0" "::/0" ];
endpoint = "[2a03:4000:6:48d::1]:50101";
publicKey = "Jr1GBeNWrYjz7QyiI8XSOSRo/kGsCCtGGAzxmM5Hkn0=";
} ];
listenPort = 50101;
allowedIPsAsRoutes = false;
privateKeyFile = "/var/src/secrets/wireguard/wg-porter6";
};
wg-nonat6 = {
ips = [ "fe80::128:1/64" "169.254.128.1/24" ];
peers = [ {
allowedIPs = [ "0.0.0.0/0" "::/0" ];
endpoint = "[2001:638:904:ffca::6]:50128";
publicKey = "0GGDyPj/0uMaba9pmOyj+Sx+3jMivpRdpTJhadl6bS8=";
} ];
listenPort = 50128;
allowedIPsAsRoutes = false;
privateKeyFile = "/var/src/secrets/wireguard/wg-nonat6";
};
wg-vcp-bula = {
ips = [ "fe80::1/64" ];
peers = [
{
allowedIPs = [ "fe80::/64" "2a01:4f8:1c0c:8221::/64" ];
publicKey = "lD/4s628IOlb6hTu7MGWWkyZoMveClGiCjuOcHCEhxo=";
}
];
listenPort = 51876;
allowedIPsAsRoutes = true;
privateKeyFile = "/var/src/secrets/wireguard/wg-vcp-bula";
};
wg-vpn = {
ips = [ "2a01:4f8:c0c:15f1::8001/113" "10.20.30.1/24" ];
peers = [
@ -143,7 +90,7 @@
};
};
networking.firewall.allowedUDPPorts = [ 53 993 995 50101 50127 50128 51820 51876 60001 ];
networking.firewall.allowedUDPPorts = [ 51820 ];
clerie.nginx-port-forward = {
enable = true;
@ -172,99 +119,10 @@
};
};
services.bird2.enable = true;
services.bird2.config = ''
router id ${ (lib.head config.networking.interfaces.lo.ipv4.addresses).address };
ipv6 table ospf6;
ipv4 table ospf4;
protocol direct {
interface "lo";
ipv6 {
table ospf6;
};
ipv4 {
table ospf4;
};
}
protocol kernel kernel_ospf6 {
ipv6 {
table ospf6;
export filter {
krt_prefsrc=${ (lib.head config.networking.interfaces.lo.ipv6.addresses).address };
accept;
};
import none;
};
}
protocol kernel kernel_ospf4 {
ipv4 {
table ospf4;
export filter {
krt_prefsrc=${ (lib.head config.networking.interfaces.lo.ipv4.addresses).address };
accept;
};
import none;
};
}
protocol ospf v3 ospf_6 {
ipv6 {
table ospf6;
import all;
export all;
};
area 0 {
interface "wg-carbon4" {
cost 80;
type pointopoint;
};
interface "wg-porter6" {
cost 80;
type pointopoint;
};
interface "wg-nonat6" {
cost 80;
type pointopoint;
};
};
}
protocol ospf v3 ospf_4 {
ipv4 {
table ospf4;
import all;
export all;
};
area 0 {
interface "wg-carbon4" {
cost 80;
type pointopoint;
};
interface "wg-porter6" {
cost 80;
type pointopoint;
};
interface "wg-nonat6" {
cost 80;
type pointopoint;
};
};
}
protocol device {
scan time 10;
}
'';
clerie.monitoring = {
enable = true;
id = "101";
pubkey = "H9Pvx/BzwEMM7acT9mioT8zBD2Yn13L82EKKqdAfeGM=";
bird = true;
};
system.stateVersion = "21.03";