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

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
         container_name: dhcp-isc-dhcp
18
         container_name: dhcp-isc-dhcp
19
 #        restart: unless-stopped
19
 #        restart: unless-stopped
20
         volumes:
20
         volumes:
21
-            - ./data/isc-dhcp:/data
21
+            - ./data/isc-dhcp/data:/data
22
+            - ./data/isc-dhcp/config:/etc/dhcp/config
22
         network_mode: host
23
         network_mode: host
23
         env_file:
24
         env_file:
24
             - env
25
             - env

+ 1
- 1
isc-dhcp/Dockerfile View File

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

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

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

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

6
 
6
 
7
 touch /data/dhcpd.leases
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
 exec dhcpd -4 -f --no-pid -d -cf /etc/dhcp/dhcpd.conf -lf /data/dhcpd.leases
10
 exec dhcpd -4 -f --no-pid -d -cf /etc/dhcp/dhcpd.conf -lf /data/dhcpd.leases

Loading…
Cancel
Save