Browse Source

updated dhcp conf and env variables; updated boot.ipxe

tags/v1.0.0
Robin Thoni 7 years ago
parent
commit
ed7501546b
6 changed files with 54 additions and 18 deletions
  1. 3
    1
      apache/vars-vars
  2. 6
    0
      data/apache/files/boot.ipxe
  3. 3
    1
      env
  4. 36
    14
      isc-dhcp/dhcpd.conf
  5. 3
    1
      isc-dhcp/vars-vars
  6. 3
    1
      tftpd/vars-vars

+ 3
- 1
apache/vars-vars View File

1
-DHCP_DDNS_KEY
1
+DHCP_TSIG_KEY_NAME
2
+DHCP_TSIG_KEY_ALGO
3
+DHCP_TSIG_KEY_SECRET
2
 
4
 
3
 DHCP_DNS_SERVER
5
 DHCP_DNS_SERVER
4
 DHCP_TFTP_SERVER
6
 DHCP_TFTP_SERVER

+ 6
- 0
data/apache/files/boot.ipxe View File

1
 #!ipxe
1
 #!ipxe
2
+:main
2
 console --picture misc/splash.png
3
 console --picture misc/splash.png
3
 menu netboot.${domain} PXE
4
 menu netboot.${domain} PXE
4
 
5
 
36
 
37
 
37
 item --gap -- Misc
38
 item --gap -- Misc
38
 item chain-online Chain on rthoni.com
39
 item chain-online Chain on rthoni.com
40
+item config Config
39
 item shell Shell
41
 item shell Shell
40
 item reboot Reboot
42
 item reboot Reboot
41
 choose choice && goto ${choice}
43
 choose choice && goto ${choice}
48
 :chain-online
50
 :chain-online
49
 chain http://netboot.rthoni.com/boot.ipxe
51
 chain http://netboot.rthoni.com/boot.ipxe
50
 
52
 
53
+:config
54
+config
55
+goto main
56
+
51
 :shell
57
 :shell
52
 shell
58
 shell
53
 
59
 

+ 3
- 1
env View File

1
-DHCP_DDNS_KEY=Y2hhbmdlX2l0
1
+DHCP_TSIG_KEY_NAME=dhcpupdate
2
+DHCP_TSIG_KEY_ALGO=hmac-sha1
3
+DHCP_TSIG_KEY_SECRET=UmY/YecbaCwQ8hKHZxNJuudOC5kWeuW64Ohgvao8vUg=
2
 
4
 
3
 DHCP_DNS_SERVER=10.15.100.1
5
 DHCP_DNS_SERVER=10.15.100.1
4
 DHCP_TFTP_SERVER=10.15.100.1
6
 DHCP_TFTP_SERVER=10.15.100.1

+ 36
- 14
isc-dhcp/dhcpd.conf View File

1
 #Dynamic DNS security settings
1
 #Dynamic DNS security settings
2
-key "dhcpdupdate" {
3
-        algorithm hmac-md5;
4
-        secret "DHCP_DDNS_KEY";
2
+key DHCP_TSIG_KEY_NAME {
3
+        algorithm DHCP_TSIG_KEY_ALGO;
4
+        secret "DHCP_TSIG_KEY_SECRET";
5
 };
5
 };
6
 
6
 
7
-zone dhcp.site.rthoni.com {
7
+zone DHCP_DYN_IPS_DOMAIN {
8
     primary DHCP_DNS_SERVER;
8
     primary DHCP_DNS_SERVER;
9
-    key dhcpdupdate;
9
+    #key DHCP_TSIG_KEY_NAME;
10
 }
10
 }
11
 
11
 
12
-zone site.rthoni.com {
12
+zone DHCP_SITE_DOMAIN {
13
     primary DHCP_DNS_SERVER;
13
     primary DHCP_DNS_SERVER;
14
-    key dhcpdupdate;
14
+    #key DHCP_TSIG_KEY_NAME;
15
 }
15
 }
16
 
16
 
17
-zone 100.15.10.in-addr.arpa. {
17
+zone DHCP_REV_DOMAIN {
18
     primary DHCP_DNS_SERVER;
18
     primary DHCP_DNS_SERVER;
19
-    key dhcpdupdate;
19
+    #key DHCP_TSIG_KEY_NAME;
20
 }
20
 }
21
 
21
 
22
 
22
 
28
 default-lease-time 600;
28
 default-lease-time 600;
29
 max-lease-time 7200;
29
 max-lease-time 7200;
30
 
30
 
31
+# Dynamic DNS update
32
+ddns-updates on;
33
+ddns-update-style interim;
34
+update-static-leases on;
35
+#allow client-updates;
36
+ddns-rev-domainname "in-addr.arpa.";
37
+
31
 # Misc settings
38
 # Misc settings
32
 use-host-decl-names on;
39
 use-host-decl-names on;
33
 authoritative;
40
 authoritative;
36
 subnet DHCP_SUBNET netmask DHCP_NETMASK {
43
 subnet DHCP_SUBNET netmask DHCP_NETMASK {
37
 
44
 
38
   # Dynamic DNS update
45
   # Dynamic DNS update
39
-  ddns-updates off; #TODO
40
-  ddns-update-style interim;
41
-  update-static-leases off;
42
   ddns-domainname "DHCP_DYN_IPS_DOMAIN";
46
   ddns-domainname "DHCP_DYN_IPS_DOMAIN";
43
-  ddns-rev-domainname "DHCP_REV_DOMAIN";
44
-
47
+  update-conflict-detection false;
45
 
48
 
46
   # IP settings
49
   # IP settings
47
   range DHCP_IP_FIRST DHCP_IP_LAST;
50
   range DHCP_IP_FIRST DHCP_IP_LAST;
71
 
74
 
72
   # Static IP hosts
75
   # Static IP hosts
73
   group {
76
   group {
77
+    host vm-pxe {
78
+      hardware ethernet 08:00:27:7b:9d:21;
79
+      fixed-address 10.15.100.10;
80
+    }
81
+    host vm-windows {
82
+      hardware ethernet 08:00:27:76:ce:95;
83
+      fixed-address 10.15.100.11;
84
+    }
74
     ddns-domainname "DHCP_SITE_DOMAIN";
85
     ddns-domainname "DHCP_SITE_DOMAIN";
86
+    option host-name = host-decl-name;
87
+    ddns-hostname = config-option host-name;
88
+  }
89
+
90
+  # Force a default hostname if not present
91
+  if option dhcp-message-type = 3 and not exists host-name and config-option host-name = null {
92
+    #ddns-hostname = concat("dyn-", binary-to-ascii(10, 8, "-", leased-address));
93
+    #option host-name = ddns-hostname;
94
+    option host-name = concat("dyn-", binary-to-ascii(10, 8, "-", leased-address));
95
+    ddns-hostname = config-option host-name;
96
+    #log(info, concat("Defaulting hostname to ", config-option host-name, " for ", binary-to-ascii(16, 8, ":", hardware)));
75
   }
97
   }
76
 }
98
 }
77
 
99
 

+ 3
- 1
isc-dhcp/vars-vars View File

1
-DHCP_DDNS_KEY
1
+DHCP_TSIG_KEY_NAME
2
+DHCP_TSIG_KEY_ALGO
3
+DHCP_TSIG_KEY_SECRET
2
 
4
 
3
 DHCP_DNS_SERVER
5
 DHCP_DNS_SERVER
4
 DHCP_TFTP_SERVER
6
 DHCP_TFTP_SERVER

+ 3
- 1
tftpd/vars-vars View File

1
-DHCP_DDNS_KEY
1
+DHCP_TSIG_KEY_NAME
2
+DHCP_TSIG_KEY_ALGO
3
+DHCP_TSIG_KEY_SECRET
2
 
4
 
3
 DHCP_DNS_SERVER
5
 DHCP_DNS_SERVER
4
 DHCP_TFTP_SERVER
6
 DHCP_TFTP_SERVER

Loading…
Cancel
Save