Ansicht umschalten
Avatar von lgkf
  • lgkf

mehr als 1000 Beiträge seit 07.05.2001

systemd-startskript für iptables läuft nicht mehr vollständig

Hi alle,
Kubuntu 20.04.02 - da habe ich ein Skript erstellt, das in einer Maschine mit 3 Netzwerkschnittstellen per iptables den Verkehr regelt. Das ist über Jahre gewachsen, umfasst aktuell 435 Regeln. Die Maschine läuft nicht durch, wird bei Bedarf gebootet, meist täglich.
Mit Systemd habe ich dieses Skript über eine service defintion in /etc/systemd/service/iptables.service automatisch gestartet:

[Unit] # iptables machtnix fwall Description=Specific iptables skript After=syslog.target network-online.target [Service] Type=oneshot ExecStart=/root/bin/machtnix.fwall [Install] # Abschnitt wird im Artikel systemd/Units beschrieben WantedBy=multi-user.target

Das hat bis vor etwa 5 Tagen gut funktioniert. Jetzt läuft das nicht mehr richtig durch, seit ein paar Tagen bemerke ich, dass direkt nach dem Start der dovecot-mailserver nicht richtig antwortet, dass virtuelle Maschinen kein Netz haben oder ähnliche Netzwerk-bezogene Probleme auftreten - wenn ich das firewall skript dann nochmal explizit starte, geht alles.
Gerade habe ich mit 'systemctl status iptables.service' gesehen, dass da wohl ein Konflikt vorliegt:

# systemctl status iptables.service ● iptables.service - Specific iptables skript Loaded: loaded (/etc/systemd/system/iptables.service; enabled; vendor preset: enabled) Active: inactive (dead) since Mon 2021-03-08 11:15:45 CET; 10min ago Process: 1626 ExecStart=/root/bin/machtnix.fwall (code=exited, status=0/SUCCESS) Main PID: 1626 (code=exited, status=0/SUCCESS) Mär 08 11:15:45 machtnix machtnix.fwall[2205]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option? Mär 08 11:15:45 machtnix machtnix.fwall[1626]: + iptables -A gbl-chk-mac -s 10.23.17.254 -m mac --mac-source 00:25:61:90:95:C0 -j ACCEPT Mär 08 11:15:45 machtnix machtnix.fwall[2206]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option? Mär 08 11:15:45 machtnix machtnix.fwall[1626]: + iptables -A gbl-chk-mac -j LOG --log-prefix xIPTx Drop gbl-chk-mac: Mär 08 11:15:45 machtnix machtnix.fwall[2207]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option? Mär 08 11:15:45 machtnix machtnix.fwall[1626]: + iptables -A gbl-chk-mac -j DROP Mär 08 11:15:45 machtnix machtnix.fwall[2208]: Another app is currently holding the xtables lock. Perhaps you want to use the -w option? Mär 08 11:15:45 machtnix machtnix.fwall[1626]: + echo 1 Mär 08 11:15:45 machtnix systemd[1]: iptables.service: Succeeded. Mär 08 11:15:45 machtnix systemd[1]: Finished Specific iptables skript. root@machtnix:~# uname -a Linux machtnix 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux root@machtnix:~# cat /etc/issue Ubuntu 20.04.2 LTS \n \l

Kann mir da jemand einen Tipp geben, welche Software da xtables benutzen könnte?
notfalls kann ich den Start auch verschieben oder wieder ganz von Hand starten - aber wenn man wüsste auf welchen Prozess man warten muss...

Danke im Voraus

lgkf

Bewerten
- +
Ansicht umschalten