Network configuration updates

This commit is contained in:
Alex 2022-05-09 00:20:02 +02:00
parent 83dd3ea25a
commit 178107af0c
Signed by untrusted user: lx
GPG key ID: 0E496D15096376BE
11 changed files with 37 additions and 35 deletions

View file

@ -12,7 +12,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.33";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::33";
deuxfleurs.ipv6 = "2a06:a004:3025:1::33";
deuxfleurs.cluster_ip = "10.83.12.147";
deuxfleurs.is_raft_server = true;

View file

@ -12,7 +12,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.31";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::31";
deuxfleurs.ipv6 = "2a06:a004:3025:1::31";
deuxfleurs.cluster_ip = "10.83.101.43";
deuxfleurs.is_raft_server = true;

View file

@ -12,7 +12,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.32";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::32";
deuxfleurs.ipv6 = "2a06:a004:3025:1::32";
deuxfleurs.cluster_ip = "10.83.66.147";
deuxfleurs.is_raft_server = true;

View file

@ -1,13 +1,13 @@
UserKnownHostsFile ./ssh_known_hosts
Host concombre
#HostName 2a01:e0a:c:a720::31
#HostName 2a06:a004:3025:1::31
HostName 192.168.1.31
Host courgette
#HostName 2a01:e0a:c:a720::32
#HostName 2a06:a004:3025:1::32
HostName 192.168.1.32
Host celeri
#HostName 2a01:e0a:c:a720::33
#HostName 2a06:a004:3025:1::33
HostName 192.168.1.33

View file

@ -17,7 +17,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.22";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::22";
deuxfleurs.ipv6 = "2a06:a004:3025:1::22";
deuxfleurs.cluster_ip = "10.14.252.121";
deuxfleurs.is_raft_server = true;

View file

@ -17,7 +17,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.21";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::21";
deuxfleurs.ipv6 = "2a06:a004:3025:1::21";
deuxfleurs.cluster_ip = "10.14.179.56";
deuxfleurs.is_raft_server = true;

View file

@ -17,7 +17,7 @@
deuxfleurs.network_interface = "eno1";
deuxfleurs.lan_ip = "192.168.1.23";
deuxfleurs.ipv6 = "2a01:e0a:c:a720::23";
deuxfleurs.ipv6 = "2a06:a004:3025:1::23";
deuxfleurs.cluster_ip = "10.14.181.82";
deuxfleurs.is_raft_server = true;

View file

@ -1,15 +1,15 @@
UserKnownHostsFile ./ssh_known_hosts
Host caribou
#HostName 2a01:e0a:c:a720::23
#HostName 2a06:a004:3025:1::23
HostName 192.168.1.23
Host carcajou
#HostName 2a01:e0a:c:a720::22
#HostName 2a06:a004:3025:1::22
HostName 192.168.1.22
Host cariacou
#HostName 2a01:e0a:c:a720::21
#HostName 2a06:a004:3025:1::21
HostName 192.168.1.21
Host spoutnik

View file

@ -9,4 +9,4 @@ copy cluster/$CLUSTER/cluster.nix /etc/nixos/cluster.nix
copy cluster/$CLUSTER/node/$NIXHOST.nix /etc/nixos/node.nix
copy cluster/$CLUSTER/node/$NIXHOST.site.nix /etc/nixos/site.nix
cmd nixos-rebuild switch
cmd nixos-rebuild switch --show-trace

View file

@ -81,21 +81,26 @@ in
}) cfg.admin_accounts;
# Configure network interfaces
networking.interfaces = attrsets.setAttrByPath [ cfg.network_interface ] {
useDHCP = false;
ipv4.addresses = [
{
address = cfg.lan_ip;
prefixLength = cfg.lan_ip_prefix_length;
}
];
ipv6.addresses = [
{
address = cfg.ipv6;
prefixLength = cfg.ipv6_prefix_length;
}
];
};
networking.interfaces =
let ip4config = {
useDHCP = false;
ipv4.addresses = [
{
address = cfg.lan_ip;
prefixLength = cfg.lan_ip_prefix_length;
}
];
};
ip6config = {
ipv6.addresses = [
{
address = cfg.ipv6;
prefixLength = cfg.ipv6_prefix_length;
}
];
};
in
(attrsets.setAttrByPath [ cfg.network_interface ] (ip4config // ip6config));
networking.defaultGateway = {
address = cfg.lan_default_gateway;
interface = cfg.network_interface;

View file

@ -6,15 +6,12 @@
10.42.2.21 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPXTUrXRFhudJBESCqjHCOttzqYPyIzpPOMkI8+SwLRx
10.42.2.22 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMf/ioVSSb19Slu+HZLgKt4f1/XsL+K9uMxazSWb/+nQ
10.42.2.23 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDsYD1gNmGyb6c9wjGR6tC69fHP6+FpPHTBT6laPTHeD
2a01:e0a:c:a720::22 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMf/ioVSSb19Slu+HZLgKt4f1/XsL+K9uMxazSWb/+nQ
2a01:e0a:c:a720::21 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPXTUrXRFhudJBESCqjHCOttzqYPyIzpPOMkI8+SwLRx
2a01:e0a:c:a720::23 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDsYD1gNmGyb6c9wjGR6tC69fHP6+FpPHTBT6laPTHeD
2a01:e0a:c:a720::33 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOuY1CvhxBP9BtKkTlmOUu6Hhy8OQTB3R8OCFXbHA/RA
2a01:e0a:c:a720::31 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL3N0QOFNGkCpVLuOHFdpnBaxIFH925KpdIHV/3F9+BR
2a01:e0a:c:a720::32 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCXJeo6yeQeTN7D7OZwLd8zbyU1jWywlhQ29yyk7x+G
192.168.1.22 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMf/ioVSSb19Slu+HZLgKt4f1/XsL+K9uMxazSWb/+nQ
192.168.1.21 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPXTUrXRFhudJBESCqjHCOttzqYPyIzpPOMkI8+SwLRx
192.168.1.23 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDsYD1gNmGyb6c9wjGR6tC69fHP6+FpPHTBT6laPTHeD
192.168.1.33 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOuY1CvhxBP9BtKkTlmOUu6Hhy8OQTB3R8OCFXbHA/RA
192.168.1.31 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL3N0QOFNGkCpVLuOHFdpnBaxIFH925KpdIHV/3F9+BR
192.168.1.32 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPCXJeo6yeQeTN7D7OZwLd8zbyU1jWywlhQ29yyk7x+G
2a06:a004:3024::22 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMf/ioVSSb19Slu+HZLgKt4f1/XsL+K9uMxazSWb/+nQ
2a06:a004:3024::21 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPXTUrXRFhudJBESCqjHCOttzqYPyIzpPOMkI8+SwLRx
2a06:a004:3024::23 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDsYD1gNmGyb6c9wjGR6tC69fHP6+FpPHTBT6laPTHeD