@cryptotaxi247 / infra-1 / commits / 5d6b75af

delft/eris: handover network configuration to networkd and resolved

Martin Weinelt committed Feb 11, 2024 at 20:34 UTC 5d6b75af775da3cdf6ab5a9ce707ebad89a2f844
3 files changed +25 -23
delft/eris-physical.nix
-23
@@ -18,29 +18,6 @@
18 imports = [
19 {
20 config = {
21 - networking = {
22 - defaultGateway = "138.201.32.65";
23 - interfaces.eth0 = {
24 - ipAddress = "138.201.32.77";
25 - prefixLength = 26;
26 - };
27 - localCommands = ''
28 - ip -6 addr add '2a01:4f8:171:33cc::/64' dev 'eth0' || true
29 - ip -4 route change '138.201.32.64/26' via '138.201.32.65' dev 'eth0' || true
30 - ip -6 route add default via 'fe80::1' dev eth0 || true
31 - '';
32 - nameservers = [
33 - "213.133.98.98"
34 - "213.133.99.99"
35 - "213.133.100.100"
36 - "2a01:4f8:0:a0a1::add:1010"
37 - "2a01:4f8:0:a102::add:9999"
38 - "2a01:4f8:0:a111::add:9898"
39 - ];
40 - };
41 - services.udev.extraRules = ''
42 - ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="90:1b:0e:91:c3:67", NAME="eth0"
43 - '';
21 users.extraUsers.root.openssh.authorizedKeys.keys = [
22 "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXnddtPlqCgmGK3yE48/eoUke4u2O2SIin6kUp4T1eZ NixOps client key of eris"
23 ];
delft/eris.nix
+1
@@ -12,6 +12,7 @@ in
12 ./eris/github-project-monitor.nix
13 ./eris/alertmanager-matrix-forwarder.nix
14 ./eris/channel-monitor.nix
15 + ./eris/network.nix
16 ];
17
18 system.stateVersion = "18.03";
delft/eris/network.nix new
+24
@@ -0,0 +1,24 @@
1 +{
2 + systemd.network = {
3 + enable = true;
4 + networks = {
5 + "30-enp0s31f6" = {
6 + matchConfig = {
7 + MACAddress = "90:1b:0e:91:c3:67";
8 + Type = "ether";
9 + };
10 + linkConfig.RequiredForOnline = true;
11 + networkConfig.Description = "WAN";
12 + address = [
13 + "138.201.32.77/26"
14 + "2a01:4f8:171:33cc::1/64"
15 + ];
16 + routes = [ {
17 + routeConfig.Gateway = "138.201.32.65";
18 + } {
19 + routeConfig.Gateway = "fe80::1";
20 + } ];
21 + };
22 + };
23 + };
24 +}