Compare commits
10 Commits
old-master
...
bba30636e0
| Author | SHA1 | Date | |
|---|---|---|---|
| bba30636e0 | |||
| 1007de7c84 | |||
| 091ecf899a | |||
| 614245b81b | |||
| 97067691f3 | |||
| 2892942fe9 | |||
| bb2c3345a0 | |||
| 4a97ca2e18 | |||
| 93586bb12b | |||
| 3160415793 |
3
keys.nix
3
keys.nix
@@ -13,10 +13,11 @@ rec {
|
|||||||
tent = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAtTpHtdYoelbknD/IcfBlThwLKJv/dSmylOgpg3FRM tent";
|
tent = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAtTpHtdYoelbknD/IcfBlThwLKJv/dSmylOgpg3FRM tent";
|
||||||
apex = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvUFjSfoxXnKwXhEFXx5ckRKJ0oewJ82mRitSMNMKjh apex";
|
apex = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBvUFjSfoxXnKwXhEFXx5ckRKJ0oewJ82mRitSMNMKjh apex";
|
||||||
weasel = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLJrQ8BF6KcweQV8pLkSbFT+tbDxSG9qxrdQE65zJZp weasel";
|
weasel = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLJrQ8BF6KcweQV8pLkSbFT+tbDxSG9qxrdQE65zJZp weasel";
|
||||||
|
raccoon = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGNQttFvL0dNEyy7klIhLoK4xXOeM2/K9R7lPMTG3qvK raccoon";
|
||||||
};
|
};
|
||||||
|
|
||||||
hostGroup = with hosts; rec {
|
hostGroup = with hosts; rec {
|
||||||
compute = [ owl1 owl2 fox ];
|
compute = [ owl1 owl2 fox raccoon ];
|
||||||
playground = [ eudy koro weasel ];
|
playground = [ eudy koro weasel ];
|
||||||
storage = [ bay lake2 ];
|
storage = [ bay lake2 ];
|
||||||
monitor = [ hut ];
|
monitor = [ hut ];
|
||||||
|
|||||||
@@ -58,10 +58,7 @@
|
|||||||
|
|
||||||
# Use SSH tunnel to reach internal hosts
|
# Use SSH tunnel to reach internal hosts
|
||||||
programs.ssh.extraConfig = ''
|
programs.ssh.extraConfig = ''
|
||||||
Host bscpm04.bsc.es gitlab-internal.bsc.es knights3.bsc.es
|
Host knights3.bsc.es
|
||||||
ProxyCommand nc -X connect -x localhost:23080 %h %p
|
|
||||||
Host raccoon
|
|
||||||
HostName knights3.bsc.es
|
|
||||||
ProxyCommand nc -X connect -x localhost:23080 %h %p
|
ProxyCommand nc -X connect -x localhost:23080 %h %p
|
||||||
Host tent
|
Host tent
|
||||||
ProxyJump raccoon
|
ProxyJump raccoon
|
||||||
|
|||||||
@@ -18,18 +18,26 @@
|
|||||||
# Public key: VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=
|
# Public key: VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{
|
||||||
name = "Fox";
|
name = "fox";
|
||||||
publicKey = "VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=";
|
publicKey = "VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=";
|
||||||
allowedIPs = [ "10.106.0.0/24" ];
|
allowedIPs = [ "10.106.0.1/32" ];
|
||||||
endpoint = "fox.ac.upc.edu:666";
|
endpoint = "fox.ac.upc.edu:666";
|
||||||
# Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
# Send keepalives every 25 seconds. Important to keep NAT tables alive.
|
||||||
persistentKeepalive = 25;
|
persistentKeepalive = 25;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "raccoon";
|
||||||
|
publicKey = "QUfnGXSMEgu2bviglsaSdCjidB51oEDBFpnSFcKGfDI=";
|
||||||
|
allowedIPs = [ "10.106.0.236/32" "192.168.0.0/16" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
"10.106.0.1" = [ "fox" ];
|
"10.106.0.1" = [ "fox" ];
|
||||||
|
"10.106.0.236" = [ "raccoon" ];
|
||||||
|
"192.168.11.12" = [ "bscpm04.bsc.es" ];
|
||||||
|
"192.168.11.15" = [ "gitlab-internal.bsc.es" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
hosts = {
|
hosts = {
|
||||||
"84.88.53.236" = [ "ssfhead.bsc.es" "ssfhead" ];
|
"84.88.53.236" = [ "ssfhead.bsc.es" "ssfhead" ];
|
||||||
"84.88.51.152" = [ "raccoon" ];
|
#"84.88.51.152" = [ "raccoon" ];
|
||||||
"84.88.51.142" = [ "raccoon-ipmi" ];
|
#"84.88.51.142" = [ "raccoon-ipmi" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,5 @@
|
|||||||
Host raccoon knights3.bsc.es
|
Host raccoon knights3.bsc.es
|
||||||
HostName knights3.bsc.es
|
HostName knights3.bsc.es
|
||||||
ProxyCommand=ssh apex 'nc -X connect -x localhost:23080 %h %p'
|
ProxyCommand=ssh apex 'nc -X connect -x localhost:23080 %h %p'
|
||||||
|
|
||||||
# Make sure we can reach gitlab even if we don't have SSH access to raccoon
|
|
||||||
Host bscpm04.bsc.es gitlab-internal.bsc.es
|
|
||||||
ProxyCommand=ssh apex 'nc -X connect -x localhost:23080 %h %p'
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,17 +24,23 @@
|
|||||||
peers = [
|
peers = [
|
||||||
# List of allowed peers.
|
# List of allowed peers.
|
||||||
{
|
{
|
||||||
name = "Apex";
|
name = "apex";
|
||||||
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
|
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
|
||||||
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
|
# List of IPs assigned to this peer within the tunnel subnet. Used to configure routing.
|
||||||
allowedIPs = [ "10.106.0.30/32" ];
|
allowedIPs = [ "10.106.0.30/32" ];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "raccoon";
|
||||||
|
publicKey = "QUfnGXSMEgu2bviglsaSdCjidB51oEDBFpnSFcKGfDI=";
|
||||||
|
allowedIPs = [ "10.106.0.236/32" ];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
"10.106.0.30" = [ "apex" ];
|
"10.106.0.30" = [ "apex" ];
|
||||||
|
"10.106.0.236" = [ "raccoon" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
../module/ssh-hut-extern.nix
|
../module/ssh-hut-extern.nix
|
||||||
../module/nvidia.nix
|
../module/nvidia.nix
|
||||||
../eudy/kernel/perf.nix
|
../eudy/kernel/perf.nix
|
||||||
|
./wireguard.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Don't install Grub on the disk yet
|
# Don't install Grub on the disk yet
|
||||||
@@ -43,6 +44,13 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Mount the NFS home
|
||||||
|
fileSystems."/nfs/home" = {
|
||||||
|
device = "10.106.0.30:/home";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [ "nfsvers=3" "rsize=1024" "wsize=1024" "cto" "nofail" ];
|
||||||
|
};
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
extra-substituters = [ "https://jungle.bsc.es/cache" ];
|
extra-substituters = [ "https://jungle.bsc.es/cache" ];
|
||||||
extra-trusted-public-keys = [ "jungle.bsc.es:pEc7MlAT0HEwLQYPtpkPLwRsGf80ZI26aj29zMw/HH0=" ];
|
extra-trusted-public-keys = [ "jungle.bsc.es:pEc7MlAT0HEwLQYPtpkPLwRsGf80ZI26aj29zMw/HH0=" ];
|
||||||
|
|||||||
47
m/raccoon/wireguard.nix
Normal file
47
m/raccoon/wireguard.nix
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
networking.nat = {
|
||||||
|
enable = true;
|
||||||
|
enableIPv6 = false;
|
||||||
|
externalInterface = "eno0";
|
||||||
|
internalInterfaces = [ "wg0" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [ 666 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets.wgRaccoon.file = ../../secrets/wg-raccoon.age;
|
||||||
|
|
||||||
|
# Enable WireGuard
|
||||||
|
networking.wireguard.enable = true;
|
||||||
|
networking.wireguard.interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
ips = [ "10.106.0.236/24" ];
|
||||||
|
listenPort = 666;
|
||||||
|
privateKeyFile = config.age.secrets.wgRaccoon.path;
|
||||||
|
# Public key: QUfnGXSMEgu2bviglsaSdCjidB51oEDBFpnSFcKGfDI=
|
||||||
|
peers = [
|
||||||
|
{
|
||||||
|
name = "fox";
|
||||||
|
publicKey = "VfMPBQLQTKeyXJSwv8wBhc6OV0j2qAxUpX3kLHunK2Y=";
|
||||||
|
allowedIPs = [ "10.106.0.1/32" ];
|
||||||
|
endpoint = "fox.ac.upc.edu:666";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "apex";
|
||||||
|
publicKey = "VwhcN8vSOzdJEotQTpmPHBC52x3Hbv1lkFIyKubrnUA=";
|
||||||
|
allowedIPs = [ "10.106.0.30/32" ];
|
||||||
|
endpoint = "ssfhead.bsc.es:666";
|
||||||
|
persistentKeepalive = 25;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hosts = {
|
||||||
|
"10.106.0.1" = [ "fox.wg" ];
|
||||||
|
"10.106.0.30" = [ "apex.wg" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ let
|
|||||||
hut = [ keys.hosts.hut ] ++ adminsKeys;
|
hut = [ keys.hosts.hut ] ++ adminsKeys;
|
||||||
fox = [ keys.hosts.fox ] ++ adminsKeys;
|
fox = [ keys.hosts.fox ] ++ adminsKeys;
|
||||||
apex = [ keys.hosts.apex ] ++ adminsKeys;
|
apex = [ keys.hosts.apex ] ++ adminsKeys;
|
||||||
|
raccoon = [ keys.hosts.raccoon ] ++ adminsKeys;
|
||||||
mon = [ keys.hosts.hut keys.hosts.tent ] ++ adminsKeys;
|
mon = [ keys.hosts.hut keys.hosts.tent ] ++ adminsKeys;
|
||||||
tent = [ keys.hosts.tent ] ++ adminsKeys;
|
tent = [ keys.hosts.tent ] ++ adminsKeys;
|
||||||
# Only expose ceph keys to safe nodes and admins
|
# Only expose ceph keys to safe nodes and admins
|
||||||
@@ -29,4 +30,5 @@ in
|
|||||||
|
|
||||||
"wg-fox.age".publicKeys = fox;
|
"wg-fox.age".publicKeys = fox;
|
||||||
"wg-apex.age".publicKeys = apex;
|
"wg-apex.age".publicKeys = apex;
|
||||||
|
"wg-raccoon.age".publicKeys = raccoon;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
secrets/wg-raccoon.age
Normal file
BIN
secrets/wg-raccoon.age
Normal file
Binary file not shown.
Reference in New Issue
Block a user