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