blob: 56524d2d506ed67d499f1b25a89e0b3f402a406a [file] [log] [blame]
Serge Bazanski5d2a70a2021-03-17 22:13:44 +01001# Functionality that used to live in bootstrap.hswaw.net, a VMm now moved back
2# into edge01.waw.bgp.wtf
Serge Bazanski6abe4fa2020-10-03 00:18:34 +02003
4{ config, pkgs, ... }: {
5 networking.bridges.bootstrap.interfaces = [];
6 networking.interfaces.bootstrap.ipv4.addresses = [
7 { address = "185.236.240.18"; prefixLength = 32; }
8 ];
Serge Bazanski957d9112022-06-12 12:26:02 +02009 systemd.network.networks."40-bootstrap".networkConfig.IgnoreCarrierLoss = true;
10 systemd.network.networks."40-bootstrap".networkConfig.ConfigureWithoutCarrier = true;
Serge Bazanski5d2a70a2021-03-17 22:13:44 +010011 services.atftpd = {
12 enable = true;
13 root = (let
14 # netboot.xyz.kpxe retrieved from netboot.xyz at 2021/03/15.
15 netbootxyz-kpxe = pkgs.fetchurl {
16 url = https://object.ceph-waw3.hswaw.net/q3k-personal/b0b99ab84eb973c8a3818ec9fd11e17b75494ad8b5e6976aebbe8b162052da47.kpxe;
17 sha256 = "0iysa8h1d2xyxdm9grmmv154jxbvw48zvjcfh6iwhwxr9sw9mfdh";
18 };
19 # netboot.xyz-undionly.kpxe retrieved from netboot.xyz at 2021/03/15.
20 netbootxyz-undionly-kpxe = pkgs.fetchurl {
21 url = https://object.ceph-waw3.hswaw.net/q3k-personal/42ca97fe5219899e208cf466cb04d2cd4fe7f7b30e0db30ef63cafabcc95b989.kpxe;
22 sha256 = "12drjp6apbrwyq7b638fngvyfkyds82cnrplihh9x28rabz9gjj2";
23 };
24 in pkgs.stdenv.mkDerivation {
25 name = "atftp-root";
26 unpackPhase = "true";
27 buildPhase = "true";
28 installPhase = ''
29 mkdir -p $out
30 cp ${netbootxyz-kpxe} $out/netboot.xyz.kpxe
31 cp ${netbootxyz-undionly-kpxe} $out/netboot.xyz-undionly.kpxe
32 '';
33 });
34 };
Serge Bazanski6abe4fa2020-10-03 00:18:34 +020035 services.dhcpd4 = {
36 enable = true;
37 interfaces = [ "bootstrap" "vl-dcsw-l3" ];
38 extraConfig = ''
39 # ISC DHCP is trash. We only use it in relay mode, yet we have to do
40 # this.
41 subnet 185.236.240.18 netmask 255.255.255.255 {}
42
43 subnet 185.236.240.6 netmask 255.255.255.254 {}
44
45 subnet 185.236.240.24 netmask 255.255.255.248 {
46 option routers 185.236.240.25;
47 range 185.236.240.29 185.236.240.30;
48 option domain-name-servers 8.8.8.8;
49 }
50
51 subnet 185.236.240.32 netmask 255.255.255.240 {
52 range 185.236.240.45 185.236.240.46;
53 option routers 185.236.240.33;
54 option domain-name-servers 8.8.8.8;
55 }
56
57 host bc01n01 {
58 hardware ethernet 00:23:ae:fe:83:20;
59 fixed-address 185.236.240.35;
60 option host-name "bc01n01";
61 }
62 host bc01n02 {
63 hardware ethernet 00:23:ae:fe:83:c4;
64 fixed-address 185.236.240.36;
65 option host-name "bc01n02";
66 }
67 host bc01n03 {
68 hardware ethernet 00:23:ae:fe:42:80;
69 fixed-address 185.236.240.37;
70 option host-name "bc01n03";
Serge Bazanski5d2a70a2021-03-17 22:13:44 +010071 filename "netboot.xyz-undionly.kpxe";
72 }
73 host bc01n04 {
74 hardware ethernet 00:23:ae:fe:7e:a8;
75 fixed-address 185.236.240.41;
76 option host-name "bc01n04";
77 filename "netboot.xyz-undionly.kpxe";
Serge Bazanski6abe4fa2020-10-03 00:18:34 +020078 }
79 host boston-packets {
80 hardware ethernet 00:23:ae:fe:45:8c;
81 fixed-address 185.236.240.38;
82 option host-name "boston-packets.hackerspace.pl";
Serge Bazanski6abe4fa2020-10-03 00:18:34 +020083 }
84 host dcr01s22 {
85 hardware ethernet 90:1b:0e:08:12:b8;
86 fixed-address 185.236.240.39;
87 option host-name "dcr01s22";
Serge Bazanski6abe4fa2020-10-03 00:18:34 +020088 }
89 host dcr01s24 {
90 hardware ethernet 90:1b:0e:31:bb:6a;
91 fixed-address 185.236.240.40;
92 option host-name "dcr01s24";
Serge Bazanski6abe4fa2020-10-03 00:18:34 +020093 }
94 host dcr03s32b1 {
95 hardware ethernet 02:01:87:4a:9a:b9;
96 fixed-address 185.236.240.26;
97 option host-name "dcr03s32b1";
98 }
99 '';
100 };
101}