[Unit] Description=Packet Filtering Framework Before=network-pre.target Wants=network-pre.target # check existence of configuration file ConditionPathExists= /etc/wpa_supplicant/wpa_supplicant-ap0.conf ConditionPathExists=!/etc/wpa_supplicant/wpa_supplicant-wlan0.conf [Service] Type=oneshot ExecStart=/sbin/iptables-restore /etc/iptables.rules ExecReload=/sbin/iptables-restore /etc/iptables.rules ExecStop=/usr/lib/systemd/scripts/iptables-flush RemainAfterExit=yes [Install] WantedBy=multi-user.target