Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions nspawn-container/scripts/10-setup-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,18 @@ if [ -n "${IPV6_IP}" ]; then
fi

# Make DNSMasq listen to the container network for split horizon or conditional forwarding
if ! grep -qxF "interface=br${VLAN}.mac" /run/dnsmasq.conf.d/custom.conf; then
echo "interface=br${VLAN}.mac" >>/run/dnsmasq.conf.d/custom.conf
kill -9 "$(cat /run/dnsmasq.pid)"
# Dnsmasq is now started with --conf-dir=/run/dnsmasq.dhcp.conf.d/ so we can drop
# our own config files into that directory, even if they aren't related to DHCP.
if [ -d /run/dnsmasq.dhcp.conf.d ]; then
# unifi network > 9.3.29
echo "interface=br${VLAN}.mac" > /run/dnsmasq.dhcp.conf.d/macvlan.conf
kill -9 "$(cat /run/dnsmasq-main.pid)"
else
# older versions
if ! grep -qxF "interface=br${VLAN}.mac" /run/dnsmasq.conf.d/custom.conf; then
echo "interface=br${VLAN}.mac" >>/run/dnsmasq.conf.d/custom.conf
kill -9 "$(cat /run/dnsmasq.pid)"
fi
fi

# (optional) IPv4 force DNS (TCP/UDP 53) through DNS container
Expand All @@ -81,4 +90,4 @@ for intfc in ${FORCED_INTFC}; do
fi
done
fi
done
done