lpi2:iptables
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| lpi2:iptables [2013/12/13 17:43] – ingo_wichmann | lpi2:iptables [2019/12/19 17:19] (aktuell) – [Links] dirk_streubel | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | ====== iptables Syntax ====== | ||
| - | |||
| - | ^ table ^ command ^ chain ^ rule-specification | ||
| - | | -t filter | -A | INPUT | -s | | ||
| - | | ::: | -C | OUTPUT | ||
| - | | ::: | -D | FORWARD | ||
| - | | ::: | -I | ::: | -o | | ||
| - | | ::: | -R | ::: | ||
| - | | -t nat | -L | PREROUTING | ||
| - | | ::: | -S | OUTPUT | ||
| - | | ::: | -F | POSTROUTING | :::| tcp | '' | ||
| - | | ::: | -Z | ::: | :::| ::: | '' | ||
| - | | -t mangle | -N | PREROUTING | ||
| - | | ::: | -X | OUTPUT | ||
| - | | ::: | -P | INPUT | -m | conntrack | --ctstate | ||
| - | | ::: | -E | POSTROUTING | | | ||
| - | (( inspiriert von: | ||
| - | {{: | ||
| - | )) | ||
| - | |||
| ====== iptables beobachten ====== | ====== iptables beobachten ====== | ||
| - | watch -d iptables -L -n -v --line-numbers | + | watch -d iptables -nvL --line-numbers |
| * -L = List (auflisten) | * -L = List (auflisten) | ||
| Zeile 27: | Zeile 7: | ||
| * --line-numbers = Regeln Nummerieren (einzelne Regeln können anhand der Nummer z.B. gelöscht werden) | * --line-numbers = Regeln Nummerieren (einzelne Regeln können anhand der Nummer z.B. gelöscht werden) | ||
| - | ====== iptables | + | ====== iptables Regeln zurücksetzen ====== |
| + | ===== filter | ||
| iptables -P INPUT ACCEPT | iptables -P INPUT ACCEPT | ||
| iptables -P OUTPUT ACCEPT | iptables -P OUTPUT ACCEPT | ||
| Zeile 33: | Zeile 14: | ||
| iptables -F | iptables -F | ||
| iptables -X | iptables -X | ||
| + | ===== nat ===== | ||
| iptables -t nat -F | iptables -t nat -F | ||
| iptables -t nat -X | iptables -t nat -X | ||
| + | |||
| + | ====== iptables Syntax ====== | ||
| + | ^ table ^ command ^ chain ^ rule-specification | ||
| + | | -t filter | -A | INPUT | -s | | ||
| + | | ::: | -C | OUTPUT | ||
| + | | ::: | -D | FORWARD | ||
| + | | ::: | -I | ::: | -o | | ||
| + | | ::: | -R | ::: | ||
| + | | -t nat | -L | PREROUTING | ||
| + | | ::: | -S | OUTPUT | ||
| + | | ::: | -F | POSTROUTING | :::| tcp | '' | ||
| + | | ::: | -Z | ::: | :::| ::: | '' | ||
| + | | -t mangle | -N | PREROUTING | ||
| + | | ::: | -X | OUTPUT | ||
| + | | ::: | -P | INPUT | -m | conntrack | '' | ||
| + | | ::: | -E | POSTROUTING | | | ||
| + | (( inspiriert von: | ||
| + | {{: | ||
| + | )) | ||
| ====== Einbindung von iptables in den Bootvorgang ====== | ====== Einbindung von iptables in den Bootvorgang ====== | ||
| - | ===== CentOS ===== | + | ===== CentOS |
| + | Paket: iptables-services | ||
| / | / | ||
| speichert die aktuell aktiven iptables-Regeln in der Datei ''/ | speichert die aktuell aktiven iptables-Regeln in der Datei ''/ | ||
| + | |||
| + | ===== CentOS (ab 7) ===== | ||
| + | wie SuSE, oder '' | ||
| + | |||
| ===== SuSE ===== | ===== SuSE ===== | ||
| Zeile 112: | Zeile 119: | ||
| update-rc.d iptables start 40 S . stop 89 0 6 . | update-rc.d iptables start 40 S . stop 89 0 6 . | ||
| + | Alternativ: | ||
| + | ''/ | ||
| + | < | ||
| + | auto eth0 | ||
| + | iface eth0 inet dhcp | ||
| + | up sh -c ' | ||
| + | </ | ||
| ====== Einfacher Paketfilter mit NAT ====== | ====== Einfacher Paketfilter mit NAT ====== | ||
| Zeile 180: | Zeile 194: | ||
| * http:// | * http:// | ||
| * http:// | * http:// | ||
| + | * https:// | ||
| + | |||
| - | ===== iptables und dhcp ===== | ||
| - | * http:// | ||
| ===== iptables und ssh ===== | ===== iptables und ssh ===== | ||
| * http:// | * http:// | ||
lpi2/iptables.1386956615.txt.gz · Zuletzt geändert: 2013/12/13 17:43 von ingo_wichmann
