File tree Expand file tree Collapse file tree 8 files changed +18
-5
lines changed
setup_debian-active-directory
setup_ubuntu-active-directory Expand file tree Collapse file tree 8 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ systemctl restart networking
3636# 3. Configure resolve file
3737cat > /etc/resolv.conf << EOF
3838search ${REALM}
39- nameserver ${PRIMARY_DC_GATEWAY_IP }
39+ nameserver ${PRIMARY_DC_FORWARDER_DNS }
4040EOF
4141
4242# 4. Set hostname
@@ -78,7 +78,8 @@ rm -f /var/lib/samba/private/*.tdb
7878echo " Provisioning Samba AD..."
7979samba-tool domain provision --use-rfc2307 --realm=" ${REALM} " --domain=" ${DOMAIN} " \
8080 --server-role=dc --dns-backend=SAMBA_INTERNAL --adminpass=" ${ADMIN_PASSWORD} " \
81- --option=" interfaces=127.0.0.1 ${PRIMARY_DC_IP} " --option=" bind interfaces only=yes"
81+ --option=" interfaces=127.0.0.1 ${PRIMARY_DC_IP} " --option=" bind interfaces only=yes" \
82+ --option=" dns forwarder=${PRIMARY_DC_FORWARDER_DNS} "
8283
8384# 11. Copy Kerberos configuration
8485echo " Configuring Kerberos..."
@@ -97,7 +98,6 @@ iface ${PRIMARY_DC_INTERFACE} inet static
9798 address ${PRIMARY_DC_IP}
9899 netmask 255.255.255.0
99100 gateway ${PRIMARY_DC_GATEWAY_IP}
100- dns-nameservers ${PRIMARY_DC_IP}
101101EOF
102102systemctl restart networking
103103
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ echo "Joining domain as additional DC..."
8080samba-tool domain join ${REALM} DC -U" administrator%${ADMIN_PASSWORD} " \
8181 --option=" interfaces=127.0.0.1 ${SECONDARY_DC_IP} " \
8282 --option=" bind interfaces only=yes" \
83+ --option=" idmap_ldb:use rfc2307 = yes" \
84+ --option=" dns forwarder=${SECONDARY_DC_FORWARDER_DNS} " \
8385 --dns-backend=SAMBA_INTERNAL
8486
8587# 11. Copy Kerberos configuration
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ echo "Joining domain as additional DC..."
8080samba-tool domain join ${REALM} RODC -U" administrator%${ADMIN_PASSWORD} " \
8181 --option=" interfaces=127.0.0.1 ${SECONDARY_DC_IP} " \
8282 --option=" bind interfaces only=yes" \
83+ --option=" idmap_ldb:use rfc2307 = yes" \
84+ --option=" dns forwarder=${SECONDARY_DC_FORWARDER_DNS} " \
8385 --dns-backend=SAMBA_INTERNAL
8486
8587# 11. Copy Kerberos configuration
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ PRIMARY_DC_IP="10.10.20.220"
77PRIMARY_DC_INTERFACE="enp1s0"
88PRIMARY_DC_NETWORK="10.10.20.0/24"
99PRIMARY_DC_GATEWAY_IP="10.10.20.1"
10+ PRIMARY_DC_FORWARDER_DNS="${PRIMARY_DC_GATEWAY_IP}"
1011PRIMARY_DC_PTR_ADDRESS="20.10.10.in-addr.arpa"
1112
1213# Secondary DC Configuration
@@ -15,6 +16,7 @@ SECONDARY_DC_IP="10.10.20.221"
1516SECONDARY_DC_INTERFACE="enp1s0"
1617SECONDARY_DC_NETWORK="10.10.20.0/24"
1718SECONDARY_DC_GATEWAY_IP="10.10.20.1"
19+ SECONDARY_DC_FORWARDER_DNS="${SECONDARY_DC_GATEWAY_IP}"
1820SECONDARY_DC_PTR_ADDRESS="20.10.10.in-addr.arpa"
1921
2022# Domain Admin Password (change this!)
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ network:
3434 via: ${PRIMARY_DC_GATEWAY_IP}
3535 nameservers:
3636 search: [${REALM} ]
37- addresses: [${PRIMARY_DC_GATEWAY_IP } ]
37+ addresses: [${PRIMARY_DC_FORWARDER_DNS } ]
3838EOF
3939chmod 600 /etc/netplan/99-${PRIMARY_DC_INTERFACE} -static-${PRIMARY_DC_IP} .yaml
4040netplan apply
@@ -92,7 +92,8 @@ rm -f /var/lib/samba/private/*.tdb
9292echo " Provisioning Samba AD..."
9393samba-tool domain provision --use-rfc2307 --realm=" ${REALM} " --domain=" ${DOMAIN} " \
9494 --server-role=dc --dns-backend=SAMBA_INTERNAL --adminpass=" ${ADMIN_PASSWORD} " \
95- --option=" interfaces=127.0.0.1 ${PRIMARY_DC_IP} " --option=" bind interfaces only=yes"
95+ --option=" interfaces=127.0.0.1 ${PRIMARY_DC_IP} " --option=" bind interfaces only=yes" \
96+ --option=" dns forwarder=${PRIMARY_DC_FORWARDER_DNS} "
9697
9798# 11. Copy Kerberos configuration
9899echo " Configuring Kerberos..."
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ echo "Joining domain as additional DC..."
9494samba-tool domain join ${REALM} DC -U" administrator%${ADMIN_PASSWORD} " \
9595 --option=" interfaces=127.0.0.1 ${SECONDARY_DC_IP} " \
9696 --option=" bind interfaces only=yes" \
97+ --option=" idmap_ldb:use rfc2307 = yes" \
98+ --option=" dns forwarder=${SECONDARY_DC_FORWARDER_DNS} " \
9799 --dns-backend=SAMBA_INTERNAL
98100
99101# 11. Copy Kerberos configuration
Original file line number Diff line number Diff line change @@ -94,6 +94,8 @@ echo "Joining domain as additional DC..."
9494samba-tool domain join ${REALM} RODC -U" administrator%${ADMIN_PASSWORD} " \
9595 --option=" interfaces=127.0.0.1 ${SECONDARY_DC_IP} " \
9696 --option=" bind interfaces only=yes" \
97+ --option=" idmap_ldb:use rfc2307 = yes" \
98+ --option=" dns forwarder=${SECONDARY_DC_FORWARDER_DNS} " \
9799 --dns-backend=SAMBA_INTERNAL
98100
99101# 11. Copy Kerberos configuration
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ PRIMARY_DC_IP="10.10.20.220"
77PRIMARY_DC_INTERFACE="enp1s0"
88PRIMARY_DC_NETWORK="10.10.20.0/24"
99PRIMARY_DC_GATEWAY_IP="10.10.20.1"
10+ PRIMARY_DC_FORWARDER_DNS="${PRIMARY_DC_GATEWAY_IP}"
1011PRIMARY_DC_PTR_ADDRESS="20.10.10.in-addr.arpa"
1112
1213# Secondary DC Configuration
@@ -15,6 +16,7 @@ SECONDARY_DC_IP="10.10.20.221"
1516SECONDARY_DC_INTERFACE="enp1s0"
1617SECONDARY_DC_NETWORK="10.10.20.0/24"
1718SECONDARY_DC_GATEWAY_IP="10.10.20.1"
19+ SECONDARY_DC_FORWARDER_DNS="${SECONDARY_DC_GATEWAY_IP}"
1820SECONDARY_DC_PTR_ADDRESS="20.10.10.in-addr.arpa"
1921
2022# Domain Admin Password (change this!)
You can’t perform that action at this time.
0 commit comments