Browse Source

moved dhcp static ips to mounted data

tags/v2.0.0
Robin Thoni 6 years ago
parent
commit
e54eaa695f

+ 4
- 0
data/isc-dhcp/config/static_ips.conf View File

@@ -0,0 +1,4 @@
1
+host my_computer {
2
+  hardware ethernet 01:23:45:67:89:ab;
3
+  fixed-address 10.15.100.254;
4
+}

+ 2
- 1
docker-compose.yml View File

@@ -18,7 +18,8 @@ services:
18 18
         container_name: dhcp-isc-dhcp
19 19
 #        restart: unless-stopped
20 20
         volumes:
21
-            - ./data/isc-dhcp:/data
21
+            - ./data/isc-dhcp/data:/data
22
+            - ./data/isc-dhcp/config:/etc/dhcp/config
22 23
         network_mode: host
23 24
         env_file:
24 25
             - env

+ 1
- 1
isc-dhcp/Dockerfile View File

@@ -20,7 +20,7 @@ COPY ./run.sh /run.sh
20 20
 
21 21
 RUN mkdir "${CONFIG_DIR}"
22 22
 
23
-COPY dhcpd.conf "${CONFIG_DIR}"/dhcpd.conf
23
+COPY ./config "${CONFIG_DIR}"
24 24
 
25 25
 EXPOSE 80
26 26
 

isc-dhcp/dhcpd.conf → isc-dhcp/config/dhcpd.conf View File

@@ -73,10 +73,7 @@ subnet DHCP_SUBNET netmask DHCP_NETMASK {
73 73
 
74 74
   # Static IP hosts
75 75
   group {
76
-    #host  {
77
-    #  hardware ethernet ;
78
-    #  fixed-address 10.15.100.;
79
-    #}
76
+    include "/etc/dhcp/config/static_ips.conf";
80 77
     ddns-domainname "DHCP_SITE_DOMAIN";
81 78
     option host-name = host-decl-name;
82 79
     ddns-hostname = config-option host-name;

+ 1
- 0
isc-dhcp/run.sh View File

@@ -6,4 +6,5 @@ replace_files
6 6
 
7 7
 touch /data/dhcpd.leases
8 8
 
9
+#exec cat /etc/dhcp/dhcpd.conf /etc/dhcp/config/static_ips.conf && dhcpd -t -cf /etc/dhcp/dhcpd.conf && dhcpd -4 -f --no-pid -d -cf /etc/dhcp/dhcpd.conf -lf /data/dhcpd.leases
9 10
 exec dhcpd -4 -f --no-pid -d -cf /etc/dhcp/dhcpd.conf -lf /data/dhcpd.leases

Loading…
Cancel
Save