INSTALL: start firewall units after network-online.target and nss-lookup.target.

Rules may contain hostnames (e.g. in allow_local_net_to_ext_service),
which iptables resolves when the rule is created. With only
After=network.target, name resolution may not be available at boot and
those rules are silently missing (seen on gw-ah and gw-km).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrisandClaude Opus 5.5 committed 2026-11-19 02:52:24 +01:00
1 parent 669a44bab1
commit 2146d4ef14
1 file changed
+10 -2
+10 -2
View File
@@ -59,7 +59,11 @@ cp /usr/local/src/ipt-gateway/conf/main_ipv6.conf.sample /etc/ipt-firewall/main_
cat <<EOF > /etc/systemd/system/ipt-firewall.service
[Unit]
Description=IPv4 Firewall with iptables
After=network.target
# - Start after network AND name resolution are available: rules may contain
# - hostnames (e.g. in allow_local_net_to_ext_service), which are resolved by
# - iptables when the rule is created.
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
SyslogIdentifier="ipt-gateway"
@@ -78,7 +82,11 @@ EOF
cat <<EOF > /etc/systemd/system/ip6t-firewall.service
[Unit]
Description=IPv6 Firewall with ip6tables
After=network.target
# - Start after network AND name resolution are available: rules may contain
# - hostnames (e.g. in allow_local_net_to_ext_service), which are resolved by
# - iptables when the rule is created.
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
SyslogIdentifier="ip6t-gateway"