iptables und -p all; warum funktioniert das nicht?

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
inne
Beiträge: 3293
Registriert: 29.06.2013 17:32:10
Lizenz eigener Beiträge: GNU General Public License
Kontaktdaten:

iptables und -p all; warum funktioniert das nicht?

Beitrag von inne » 30.08.2015 10:44:12

Warum funktioniert diese iptabels Regel nicht? Das Schlüsselwort all für den Schalter -p ist doch gültig – oder?

Code: Alles auswählen

iptables -t nat -A OUTPUT -p all -j REDIRECT --to-ports 9040

eggy
Beiträge: 3334
Registriert: 10.05.2008 11:23:50

Re: iptables und -p all; warum funktioniert das nicht?

Beitrag von eggy » 30.08.2015 11:29:43

Ich könnt mir vorstellen, es liegt daran, dass es Protokolle gibt, die keine Ports kennen.

Benutzeravatar
KBDCALLS
Moderator
Beiträge: 22455
Registriert: 24.12.2003 21:26:55
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: Dortmund
Kontaktdaten:

Re: iptables und -p all; warum funktioniert das nicht?

Beitrag von KBDCALLS » 30.08.2015 12:03:48

Welcher Kernel usw. ?
Was haben Windows und ein Uboot gemeinsam?
Kaum macht man ein Fenster auf, gehen die Probleme los.

EDV ist die Abkürzung für: Ende der Vernunft

Bevor du einen Beitrag postest:
  • Kennst du unsere Verhaltensregeln
  • Lange Codezeilen/Logs gehören nach NoPaste, in Deinen Beitrag dann der passende Link dazu.

inne
Beiträge: 3293
Registriert: 29.06.2013 17:32:10
Lizenz eigener Beiträge: GNU General Public License
Kontaktdaten:

Re: iptables und -p all; warum funktioniert das nicht?

Beitrag von inne » 30.08.2015 12:46:15

Naja Ports sind auch nicht gefragt. Das soll eigentlich jeden Port matchen.

Wenn ich ein einzelnes Protokoll angebe mit tcp/udp/icmp funktioniert es...
KBDCALLS hat geschrieben:Welcher Kernel usw. ?
Jessie; linux-image-amd64.

eggy
Beiträge: 3334
Registriert: 10.05.2008 11:23:50

Re: iptables und -p all; warum funktioniert das nicht?

Beitrag von eggy » 30.08.2015 15:23:32

iptables-extensions manpage sagt:
REDIRECT
This target is only valid in the nat table, in the PREROUTING and OUTPUT chains, and user-defined chains which are only called from those chains. It redirects the packet to the machine itself by changing the destination IP to the primary address of the incoming interface (locally-generated packets are mapped to the localhost address, 127.0.0.1 for IPv4 and ::1 for IPv6).

--to-ports port[-port]
This specifies a destination port or range of ports to use: without this, the destination port is never altered. This is only valid if the rule also specifies one of the following protocols: tcp, udp, dccp or sctp.

Antworten