adding dhcpd
This commit is contained in:
parent
e8da707df7
commit
282c8a872c
2 changed files with 159 additions and 1 deletions
|
@ -57,7 +57,7 @@ in {
|
|||
virtual = true;
|
||||
name = "vpn";
|
||||
ipv4.addresses = [ { address = 10.9.1.1; prefixlen = 16; } ];
|
||||
}
|
||||
};
|
||||
|
||||
# using nftables so firewall has to be disabled
|
||||
networking.firewall.enable = false;
|
||||
|
@ -149,6 +149,12 @@ in {
|
|||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = [ vuko-pubkey ];
|
||||
|
||||
services.dhcpd4 = {
|
||||
enable = true;
|
||||
configFile = ./dhcpd.conf;
|
||||
interfaces = ["lan"];
|
||||
}
|
||||
|
||||
services.knot = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
|
|
152
dhcpd.conf
Normal file
152
dhcpd.conf
Normal file
|
@ -0,0 +1,152 @@
|
|||
option domain-search "waw.hackerspace.pl";
|
||||
option domain-name-servers 10.8.1.2;
|
||||
default-lease-time 600;
|
||||
max-lease-time 600;
|
||||
one-lease-per-client true;
|
||||
|
||||
option cisco-ip-phone-tftp code 150 = ip-address;
|
||||
|
||||
subnet 10.8.0.0 netmask 255.255.0.0 {
|
||||
|
||||
option routers 10.8.1.2;
|
||||
range 10.8.0.20 10.8.0.199;
|
||||
authoritative;
|
||||
allow bootp;
|
||||
#set clHW = concat (
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 1, 1))),2), ":",
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 2, 1))),2), ":",
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 3, 1))),2), ":",
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 4, 1))),2), ":",
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 5, 1))),2), ":",
|
||||
# suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 6, 1))),2));
|
||||
#if exists user-class and option user-class = "iPXE" {
|
||||
# # set uri = concat("http://10.8.0.151:5000/gpxe/start/", clHW);
|
||||
# # filename = uri;
|
||||
# filename "boot.ipxe";
|
||||
#} elsif substring (option vendor-class-identifier, 15, 5) = "00000" {
|
||||
# filename "netboot.xyz.kpxe";
|
||||
# #filename "ipxe.bin";
|
||||
#} else {
|
||||
# filename "netboot.xyz.efi";
|
||||
#}
|
||||
|
||||
next-server 10.8.1.2;
|
||||
host dht21 {
|
||||
hardware ethernet 5c:cf:7f:06:9a:3e;
|
||||
fixed-address 10.8.1.25;
|
||||
}
|
||||
host laser {
|
||||
hardware ethernet 00:0e:35:1d:a1:a4;
|
||||
fixed-address 10.8.1.18;
|
||||
}
|
||||
host ledpanel {
|
||||
hardware ethernet 00:0A:35:00:01:22;
|
||||
fixed-address 10.8.1.26;
|
||||
}
|
||||
host bridgeport {
|
||||
hardware ethernet 00:13:21:68:04:7b;
|
||||
fixed-address 10.8.1.29;
|
||||
}
|
||||
host 3printers1cups {
|
||||
hardware ethernet 02:20:f5:20:6a:2d;
|
||||
fixed-address 10.8.1.30;
|
||||
}
|
||||
|
||||
host inventory {
|
||||
hardware ethernet 90:e6:ba:84:b6:e0;
|
||||
fixed-address 10.8.1.38;
|
||||
}
|
||||
|
||||
host camera {
|
||||
hardware ethernet 52:54:00:1f:63:1b;
|
||||
fixed-address 10.8.1.39;
|
||||
}
|
||||
|
||||
host telelele {
|
||||
hardware ethernet fe:77:d6:83:26:b1;
|
||||
fixed-address 10.8.1.31;
|
||||
}
|
||||
|
||||
# Cisco IP Phone
|
||||
host SEPA40CC394DB0C {
|
||||
hardware ethernet a4:0c:c3:94:db:0c;
|
||||
next-server 10.8.1.2;
|
||||
# managed by dfgg/drozdziak
|
||||
#option cisco-ip-phone-tftp 10.8.0.190;
|
||||
option cisco-ip-phone-tftp 10.8.1.2;
|
||||
fixed-address 10.8.1.42;
|
||||
}
|
||||
|
||||
# RIPE Atlas Probe
|
||||
host ripeatlas {
|
||||
hardware ethernet c0:25:e9:99:fb:e8;
|
||||
fixed-address 10.8.1.43;
|
||||
}
|
||||
|
||||
# vending
|
||||
host vending {
|
||||
#hardware ethernet b8:27:eb:71:e4:0e;
|
||||
#hardware ethernet b8:27:eb:3d:ba:fe;
|
||||
hardware ethernet b8:27:eb:03:69:01;
|
||||
fixed-address 10.8.1.32;
|
||||
}
|
||||
|
||||
host transcend {
|
||||
hardware ethernet b0:38:29:2e:5d:c9;
|
||||
fixed-address 10.8.1.33;
|
||||
}
|
||||
|
||||
host welcomer {
|
||||
hardware ethernet b8:27:eb:37:9e:6e;
|
||||
fixed-address 10.8.1.34;
|
||||
}
|
||||
|
||||
host chromecast {
|
||||
hardware ethernet 6c:ad:f8:52:4c:a7;
|
||||
fixed-address 10.8.1.47;
|
||||
}
|
||||
|
||||
host staszkecoin {
|
||||
hardware ethernet 02:42:24:75:eb:19;
|
||||
fixed-address 10.8.1.49;
|
||||
}
|
||||
|
||||
# craptrap VM
|
||||
host winbox {
|
||||
hardware ethernet 52:54:00:D9:DB:42;
|
||||
fixed-address 10.8.1.48;
|
||||
}
|
||||
}
|
||||
|
||||
# Printer subnet (10.10.7.0/24) has ip-helper 10.8.1.2 set on hs-core01.
|
||||
# Make DHCP happen.
|
||||
subnet 10.10.7.0 netmask 255.255.255.0 {
|
||||
option routers 10.10.7.1;
|
||||
range 10.10.7.100 10.10.7.200;
|
||||
authoritative;
|
||||
allow bootp;
|
||||
}
|
||||
|
||||
# Listen for relayed requests on the interface from core01
|
||||
# (even though we're not serving anything there directly)
|
||||
subnet 172.16.1.0 netmask 255.255.255.250 {
|
||||
}
|
||||
|
||||
subnet 10.10.5.0 netmask 255.255.255.0 {
|
||||
option routers 10.10.5.1;
|
||||
range 10.10.5.100 10.10.5.200;
|
||||
authoritative;
|
||||
allow bootp;
|
||||
filename "elilo.efi";
|
||||
next-server 10.8.1.16;
|
||||
# option pxelinux.configfile "elilo.conf"
|
||||
}
|
||||
# itanic ilo gnuj
|
||||
subnet 10.10.1.0 netmask 255.255.255.0 {
|
||||
option routers 10.10.1.1;
|
||||
range 10.10.1.150 10.10.1.200;
|
||||
authoritative;
|
||||
next-server 10.8.1.16;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue