From 9f32f94780591605b6831bf48a73eb7d56bd4cca Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 7 Oct 2018 11:56:58 -0500 Subject: [PATCH] Move DHCP service to dns1.p.b The DHCP server on the UniFi Security Gateway is pretty limited; it cannot manage static leases (reservations), and does not offer any way to build dynamic values for e.g. hostname or boot filename. Rather than give up these features, I decided to just move the DHCP server to one of the Raspberry Pis; the DNS server made the most sense. To facilitate this move, I created the *pyrocufflink-dhcp* host group, and moved the DHCP configuration variables there. Thus, it was a simple matter of adding *dns1.pyrocufflink.blue* to this group to relocate the service. Of course, to serve clients on the other subnets, the gateway needs to have DHCP relay enabled and pointing to the new server. --- .../dhcpd.yml => pyrocufflink-dhcp.yml} | 20 +++++++++++-------- hosts | 5 ++++- 2 files changed, 16 insertions(+), 9 deletions(-) rename group_vars/{dch-gw/dhcpd.yml => pyrocufflink-dhcp.yml} (95%) diff --git a/group_vars/dch-gw/dhcpd.yml b/group_vars/pyrocufflink-dhcp.yml similarity index 95% rename from group_vars/dch-gw/dhcpd.yml rename to group_vars/pyrocufflink-dhcp.yml index 8afe5c1..2ece36f 100644 --- a/group_vars/dch-gw/dhcpd.yml +++ b/group_vars/pyrocufflink-dhcp.yml @@ -20,6 +20,7 @@ dhcp_subnets: end: 172.30.0.253 routers: - 172.30.0.241 + dns_servers: '{{ dch_networks.mgmt.dns_servers_v4 }}' ntp_servers: '{{ dch_networks.mgmt.ntp_servers }}' # pyrocufflink.blue @@ -58,8 +59,8 @@ dhcp_subnets: routers: - 172.24.100.1 dns_servers: - - 208.67.222.222 - - 208.67.220.220 + - 1.1.1.1 + - 1.0.0.1 ntp_servers: - 0.fedora.pool.ntp.org - 1.fedora.pool.ntp.org @@ -92,12 +93,9 @@ dhcp_reservations: mac_addr: 52:54:00:aa:5c:01 # pyrocufflink.blue -- host: dc0.pyrocufflink.blue - ip_addr: 172.30.0.10 - mac_addr: 52:54:00:e0:fa:f9 -- host: dc1.pyrocufflink.blue - ip_addr: 172.30.0.9 - mac_addr: b8:27:eb:0d:db:19 +- host: dns1.pyrocufflink.blue + ip_addr: 172.30.0.3 + mac_addr: b8:27:eb:1b:d9:23 - host: dns0.pyrocufflink.blue ip_addr: 172.30.0.4 mac_addr: 52:54:00:b8:8b:64 @@ -110,6 +108,12 @@ dhcp_reservations: - host: zbx0.pyrocufflink.blue ip_addr: 172.30.0.7 duid: ff:4a:0e:44:56:00:02:00:00:ab:11:ef:11:04:5c:28:85:54:96 +- host: dc1.pyrocufflink.blue + ip_addr: 172.30.0.9 + mac_addr: b8:27:eb:0d:db:19 +- host: dc0.pyrocufflink.blue + ip_addr: 172.30.0.10 + mac_addr: 52:54:00:e0:fa:f9 - host: diddy.pyrocufflink.blue ip_addr: 172.30.0.13 mac_addr: 74:da:38:8f:94:4f diff --git a/hosts b/hosts index 4843930..5404aeb 100644 --- a/hosts +++ b/hosts @@ -28,7 +28,7 @@ dch-gw vm-hosts [dhcpd:children] -dch-gw +pyrocufflink-dhcp [file-servers] file0.pyrocufflink.blue @@ -82,6 +82,9 @@ vmhost0.pyrocufflink.blue web0.pyrocufflink.blue zbx0.pyrocufflink.blue +[pyrocufflink-dhcp] +dns1.pyrocufflink.blue + [pyrocufflink-dns] dns0.pyrocufflink.blue dns1.pyrocufflink.blue