kernel hat geschrieben:Ich dachte immer, das wäre nur ein Frontend für iptables, aber es läuft irgendwie ein Dienst dazu (zumindest beim Booten)?
systemctl reload iptables.service
service iptables save
Redirecting to /bin/systemctl save iptables.service
Unknown operation 'save'.
doktor5000 hat geschrieben:sollte die Regel neu laden.
- Code: Alles auswählen
systemctl reload iptables.service
kernel hat geschrieben:service iptables save
Redirecting to /bin/systemctl save iptables.service
Unknown operation 'save'.
[doktor5000@Mageia5]─[19:35:07]─[~] systemctl status iptables.service
● iptables.service - iptables Firewall for IPv4
Loaded: loaded ([b]/usr/lib/systemd/system/iptables.service[/b]; enabled)
Active: active (exited) since Mi 2016-02-24 21:04:52 CET; 6 days ago
Process: 3139 ExecStart=/usr/libexec/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 3139 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/iptables.service
[doktor5000@Mageia5]─[19:36:24]─[~] systemctl cat iptables.service
# /usr/lib/systemd/system/iptables.service
[Unit]
Description=iptables Firewall for IPv4
After=syslog.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/libexec/iptables.init start
ExecStop=/usr/libexec/iptables.init stop
ExecReload=/usr/libexec/iptables.init reload
Environment=BOOTUP=serial
Environment=CONSOLETYPE=serial
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=basic.target
[doktor5000@Mageia5]─[19:39:30]─[~] /usr/libexec/iptables.init
Usage: /usr/libexec/iptables.init {start|stop|restart|condrestart|status|panic|save|check}
doktor5000 hat geschrieben:/usr/libexec/iptables.init [-->] /sbin/iptables-restore [-->] IPTABLES_CONFIG=/etc/sysconfig/iptables [...] beim Booten geladen werden.
systemctl is-enabled iptables.service
systemctl show -p Requires,Wants,Requisite,BindsTo,PartOf,Before,After iptables.service
systemctl status iptables.service -al -n250
doktor5000 hat geschrieben:
- Code: Alles auswählen
systemctl is-enabled iptables.service
enabled
doktor5000 hat geschrieben:
- Code: Alles auswählen
systemctl show -p Requires,Wants,Requisite,BindsTo,PartOf,Before,After iptables.service
Requires=basic.target
Requisite=
Wants=system.slice
BindsTo=
PartOf=
Before=shutdown.target network.service
After=syslog.target systemd-journald.socket basic.target system.slice
doktor5000 hat geschrieben:
- Code: Alles auswählen
systemctl status iptables.service -al -n250
● iptables.service - iptables Firewall for IPv4
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: active (exited) since Do 2016-03-03 10:24:38 CET; 4h 17min ago
Process: 776 ExecStart=/usr/libexec/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 776 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/iptables.service
Mär 03 10:24:38 <Servername zensiert> iptables.init[776]: Applying iptables firewall rules:
Mär 03 10:24:38 <Servername zensiert> iptables.init[776]: [ OK ]
doktor5000 hat geschrieben:rc.local
# Generated by iptables-save v1.4.21 on Thu Mar 3 10:21:30 2016
*nat
:PREROUTING ACCEPT [47:3052]
:INPUT ACCEPT [47:3052]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Thu Mar 3 10:21:30 2016
# Generated by iptables-save v1.4.21 on Thu Mar 3 10:21:30 2016
*mangle
:PREROUTING ACCEPT [236:16598]
:INPUT ACCEPT [236:16598]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [57:6568]
:POSTROUTING ACCEPT [57:6568]
:tcfor - [0:0]
:tcin - [0:0]
:tcout - [0:0]
:tcpost - [0:0]
:tcpre - [0:0]
COMMIT
# Completed on Thu Mar 3 10:21:30 2016
# Generated by iptables-save v1.4.21 on Thu Mar 3 10:21:30 2016
*raw
:PREROUTING ACCEPT [236:16598]
:OUTPUT ACCEPT [57:6568]
[0:0] -A PREROUTING -p udp -m udp --dport 10080 -j CT --helper amanda
[0:0] -A PREROUTING -p tcp -m tcp --dport 21 -j CT --helper ftp
[0:0] -A PREROUTING -p udp -m udp --dport 1719 -j CT --helper RAS
[0:0] -A PREROUTING -p tcp -m tcp --dport 1720 -j CT --helper Q.931
[0:0] -A PREROUTING -p tcp -m tcp --dport 6667 -j CT --helper irc
[97:7566] -A PREROUTING -p udp -m udp --dport 137 -j CT --helper netbios-ns
[0:0] -A PREROUTING -p tcp -m tcp --dport 1723 -j CT --helper pptp
[0:0] -A PREROUTING -p tcp -m tcp --dport 6566 -j CT --helper sane
[0:0] -A PREROUTING -p udp -m udp --dport 5060 -j CT --helper sip
[10:1060] -A PREROUTING -p udp -m udp --dport 161 -j CT --helper snmp
[0:0] -A PREROUTING -p udp -m udp --dport 69 -j CT --helper tftp
[0:0] -A OUTPUT -p udp -m udp --dport 10080 -j CT --helper amanda
[0:0] -A OUTPUT -p tcp -m tcp --dport 21 -j CT --helper ftp
[0:0] -A OUTPUT -p udp -m udp --dport 1719 -j CT --helper RAS
[0:0] -A OUTPUT -p tcp -m tcp --dport 1720 -j CT --helper Q.931
[0:0] -A OUTPUT -p tcp -m tcp --dport 6667 -j CT --helper irc
[0:0] -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns
[0:0] -A OUTPUT -p tcp -m tcp --dport 1723 -j CT --helper pptp
[0:0] -A OUTPUT -p tcp -m tcp --dport 6566 -j CT --helper sane
[0:0] -A OUTPUT -p udp -m udp --dport 5060 -j CT --helper sip
[0:0] -A OUTPUT -p udp -m udp --dport 161 -j CT --helper snmp
[0:0] -A OUTPUT -p udp -m udp --dport 69 -j CT --helper tftp
COMMIT
# Completed on Thu Mar 3 10:21:30 2016
# Generated by iptables-save v1.4.21 on Thu Mar 3 10:21:30 2016
*filter
:INPUT ACCEPT [236:16598]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [57:6568]
COMMIT
# Completed on Thu Mar 3 10:21:30 2016
kernel hat geschrieben:Mär 03 10:24:38 <Servername zensiert> iptables.init[776]: Applying iptables firewall rules:
Mär 03 10:24:38 <Servername zensiert> iptables.init[776]: [ OK ]
# We do _not_ need to flush/clear anything when using iptables-restore
echo $"Applying iptables firewall rules: "
grep -v "^[[:space:]]*#" $IPTABLES_CONFIG | grep -v '^[[:space:]]*$' | /sbin/iptables-restore -c && \
success $"Applying iptables firewall rules" || \
failure $"Applying iptables firewall rules"
echo
grep -v "^[[:space:]]*#" /etc/sysconfig/iptables | grep -v '^[[:space:]]*$'
doktor5000 hat geschrieben:Zeig mal bitte die Ausgabe von
- Code: Alles auswählen
grep -v "^[[:space:]]*#" /etc/sysconfig/iptables | grep -v '^[[:space:]]*$'
*nat
:PREROUTING ACCEPT [47:3052]
:INPUT ACCEPT [47:3052]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
*mangle
:PREROUTING ACCEPT [236:16598]
:INPUT ACCEPT [236:16598]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [57:6568]
:POSTROUTING ACCEPT [57:6568]
:tcfor - [0:0]
:tcin - [0:0]
:tcout - [0:0]
:tcpost - [0:0]
:tcpre - [0:0]
COMMIT
*raw
:PREROUTING ACCEPT [236:16598]
:OUTPUT ACCEPT [57:6568]
[0:0] -A PREROUTING -p udp -m udp --dport 10080 -j CT --helper amanda
[0:0] -A PREROUTING -p tcp -m tcp --dport 21 -j CT --helper ftp
[0:0] -A PREROUTING -p udp -m udp --dport 1719 -j CT --helper RAS
[0:0] -A PREROUTING -p tcp -m tcp --dport 1720 -j CT --helper Q.931
[0:0] -A PREROUTING -p tcp -m tcp --dport 6667 -j CT --helper irc
[97:7566] -A PREROUTING -p udp -m udp --dport 137 -j CT --helper netbios-ns
[0:0] -A PREROUTING -p tcp -m tcp --dport 1723 -j CT --helper pptp
[0:0] -A PREROUTING -p tcp -m tcp --dport 6566 -j CT --helper sane
[0:0] -A PREROUTING -p udp -m udp --dport 5060 -j CT --helper sip
[10:1060] -A PREROUTING -p udp -m udp --dport 161 -j CT --helper snmp
[0:0] -A PREROUTING -p udp -m udp --dport 69 -j CT --helper tftp
[0:0] -A OUTPUT -p udp -m udp --dport 10080 -j CT --helper amanda
[0:0] -A OUTPUT -p tcp -m tcp --dport 21 -j CT --helper ftp
[0:0] -A OUTPUT -p udp -m udp --dport 1719 -j CT --helper RAS
[0:0] -A OUTPUT -p tcp -m tcp --dport 1720 -j CT --helper Q.931
[0:0] -A OUTPUT -p tcp -m tcp --dport 6667 -j CT --helper irc
[0:0] -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns
[0:0] -A OUTPUT -p tcp -m tcp --dport 1723 -j CT --helper pptp
[0:0] -A OUTPUT -p tcp -m tcp --dport 6566 -j CT --helper sane
[0:0] -A OUTPUT -p udp -m udp --dport 5060 -j CT --helper sip
[0:0] -A OUTPUT -p udp -m udp --dport 161 -j CT --helper snmp
[0:0] -A OUTPUT -p udp -m udp --dport 69 -j CT --helper tftp
COMMIT
*filter
:INPUT ACCEPT [236:16598]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [57:6568]
COMMIT
kernel hat geschrieben:EDIT: Sollte noch hinzufügen: Wenn ich es manuell wieder einspiele, dann klappt es. Die Rules werden dann übernommen.
doktor5000 hat geschrieben:Manuell einspielen wie genau?
iptables-restore /etc/sysconfig/iptables
grep -v "^[[:space:]]*#" /etc/sysconfig/iptables | grep -v '^[[:space:]]*$'| /sbin/iptables-restore -c
doktor5000 hat geschrieben:
- Code: Alles auswählen
grep -v "^[[:space:]]*#" /etc/sysconfig/iptables | grep -v '^[[:space:]]*$'| /sbin/iptables-restore -c
doktor5000 hat geschrieben:sollte das was du ausführst gar nicht funktionieren, da es eigentlich nur von stdin liest
iptables-restore < /etc/sysconfig/iptables
kernel hat geschrieben:doktor5000 hat geschrieben:
- Code: Alles auswählen
grep -v "^[[:space:]]*#" /etc/sysconfig/iptables | grep -v '^[[:space:]]*$'| /sbin/iptables-restore -c
Da kommt leider gar nichts.
echo $?
kernel hat geschrieben:doktor5000 hat geschrieben:sollte das was du ausführst gar nicht funktionieren, da es eigentlich nur von stdin liest
Ich schätze, dass du meintest, dass man es eigentlich so machen müsste:
- Code: Alles auswählen
iptables-restore < /etc/sysconfig/iptables
kernel hat geschrieben:Naja... gut, also, dann schätze ich mal, dass ich um die Geschichte mit der rc.local nicht drumrum komme und dass Einlesen dann wohl tatsächlich da gemacht werden muss?
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast