...
Sv translation | ||
---|---|---|
| ||
CentOS 7On Auf CentOS 7 , wird firewall-cmd is used to maintain the firewall. List All Ruleszur Wartung der Firewall verwendet. Alle Regeln auflistenfirewall-cmd --list-all Allow a portEinen Port zulassenDieses Beispiel erlaubt einen TCP-Port durch die Firewall für alle Netzwerkschnittstellen in der "public" (öffentlichen) ZoneThis example allows a TCP port through the firewall, for all network interfaces in the "public" zone: This example allows a UDP port through the firewall, for all network interfaces in the Dieses Beispiel erlaubt einen UDP-Port durch die Firewall für alle Netzwerkschnittstellen in der "public" zoneZone: Löschen einer Regelfirewall-cmd --zone=public --remove-port=3306/tcp --permanent Reload the firewallDie Firewall neu ladenDadurch werden die Portänderungen aktivThis makes the port changes active: firewall-cmd --reloadIf port changes are specified without the Wenn Port-Änderungen ohne das Kennzeichen --permanent flag, they will be active, but not permanent. The following command makes themangegeben werden, sind sie aktiv, aber nicht dauerhaft. Der folgende Befehl macht sie permanent: firewall-cmd --runtime-to-permanent CentOS 6On Auf CentOS 6 , iptables is used to maintain the firewall. Caution: iptables is cryptic and sometimes rather stupid. Especially: it will add multiple rules for the same port, and does not check if the port is already open. List All Ruleswird iptables zur Wartung der Firewall verwendet. Vorsicht: iptables ist kryptisch und manchmal etwas dumm. Besonders: es fügt mehrere Regeln für den gleichen Port hinzu und prüft nicht, ob der Port bereits offen ist.. Alle Regeln auflisteniptables -L -n The -n option causes the ports to be listed numerically. Die Option -n bewirkt, dass die Ports numerisch aufgelistet werden. AlternativAlternatively: iptables-save > iptables_rules less iptables_rules This method is particularly useful for cleaning up duplicated rules. Allow a portDiese Methode ist besonders nützlich, um doppelte Regeln zu bereinigen. Einen Port zulassenDieses Beispiel lässt einen TCP-Port durch die Firewall zuThis example allows a TCP port through the firewall: This example allows a UDP port through the firewall, for all network interfaces in the Dieses Beispiel erlaubt einen UDP-Port durch die Firewall für alle Netzwerkschnittstellen in der "public" zoneZone: Reload the firewallFirewall neu ladenDadurch werden die Portänderungen dauerhaftThis makes the port changes permanent: service iptables save Delete a ruleThe simplest way to delete rules in iptables, is to save and restore the configuration: Löschen einer RegelDer einfachste Weg, Regeln in iptables zu löschen, ist das Speichern und Wiederherstellen der Konfiguration: Speichern Sie zunächst die RegelnFirst, save the rules: iptables-save > iptables_rules Now edit the rulesBearbeiten Sie nun die Regeln: vi iptables_rules Now restore the rules, with the changes made, and make them permanentStellen Sie nun die Regeln mit den vorgenommenen Änderungen wieder her und machen Sie sie dauerhaft: iptables-restore < iptables_rules |