Skip to contentSkip to conversation

doc: libxt_MARK: OUTPUT chain is fine, too

PATCH In review Phil Sutter 2 participants 4 messages May 19, 2020 – May 27, 2020 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 doc: libxt_MARK: OUTPUT chain is fine, too

In order to route packets originating from the host itself based on fwmark, mangle table's OUTPUT chain must be used. Mention this chain as alternative to PREROUTING.

Fixes c9be7f153f7bf ("doc: libxt_MARK: no longer restricted to mangle table")
---
 extensions/libxt_MARK.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extensions/libxt_MARK.man +2 -2
index 712fb76f7340c..b2408597e98f1 100644
@@ -1,7 +1,7 @@
 This target is used to set the Netfilter mark value associated with the packet.
 It can, for example, be used in conjunction with routing based on fwmark (needs
-iproute2). If you plan on doing so, note that the mark needs to be set in the
-PREROUTING chain of the mangle table to affect routing.
+iproute2). If you plan on doing so, note that the mark needs to be set in
+either the PREROUTING or the OUTPUT chain of the mangle table to affect routing.
 The mark field is 32 bits wide.
 .TP
 \fB\-\-set\-xmark\fP \fIvalue\fP[\fB/\fP\fImask\fP]
Signature · 1 line
2.26.2
#1 lore raw
Quoted 15 lines · Phil Sutter

In order to route packets originating from the host itself based on fwmark, mangle table's OUTPUT chain must be used. Mention this chain as alternative to PREROUTING.

Fixes c9be7f153f7bf ("doc: libxt_MARK: no longer restricted to mangle table")
---
 extensions/libxt_MARK.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extensions/libxt_MARK.man +0 -0
index 712fb76f7340c..b2408597e98f1 100644

extensions/libxt_MARK.man line 4

Quoted 6 lines
extensions/libxt_MARK.man +2 -2
@@ -1,7 +1,7 @@
 This target is used to set the Netfilter mark value associated with the packet.
 It can, for example, be used in conjunction with routing based on fwmark (needs
-iproute2). If you plan on doing so, note that the mark needs to be set in the
-PREROUTING chain of the mangle table to affect routing.
+iproute2). If you plan on doing so, note that the mark needs to be set in
+either the PREROUTING or the OUTPUT chain of the mangle table to affect routing.

You have two choices:

* Set the mark in filter OUTPUT chain => it does not affect routing.
* Set the mark in the mangle OUTPUT chain => it _does_ affect routing.

Are we on the same page?

#2 lore raw
Quoted 25 lines · Pablo Neira Ayuso
Quoted 15 lines · Phil Sutter

In order to route packets originating from the host itself based on fwmark, mangle table's OUTPUT chain must be used. Mention this chain as alternative to PREROUTING.

Fixes c9be7f153f7bf ("doc: libxt_MARK: no longer restricted to mangle table")
---
 extensions/libxt_MARK.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extensions/libxt_MARK.man +0 -0
index 712fb76f7340c..b2408597e98f1 100644

extensions/libxt_MARK.man line 4

Quoted 6 lines
extensions/libxt_MARK.man +2 -2
@@ -1,7 +1,7 @@
 This target is used to set the Netfilter mark value associated with the packet.
 It can, for example, be used in conjunction with routing based on fwmark (needs
-iproute2). If you plan on doing so, note that the mark needs to be set in the
-PREROUTING chain of the mangle table to affect routing.
+iproute2). If you plan on doing so, note that the mark needs to be set in
+either the PREROUTING or the OUTPUT chain of the mangle table to affect routing.

You have two choices:

Quoted 4 lines

* Set the mark in filter OUTPUT chain => it does not affect routing.
* Set the mark in the mangle OUTPUT chain => it _does_ affect routing.

Are we on the same page?

Ah, I right I just re-read and it looks fine.

author reviewer
#3 lore raw
Quoted 26 lines · Pablo Neira Ayuso
Quoted 25 lines · Pablo Neira Ayuso
Quoted 15 lines · Phil Sutter

In order to route packets originating from the host itself based on fwmark, mangle table's OUTPUT chain must be used. Mention this chain as alternative to PREROUTING.

Fixes c9be7f153f7bf ("doc: libxt_MARK: no longer restricted to mangle table")
---
 extensions/libxt_MARK.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
extensions/libxt_MARK.man +0 -0
index 712fb76f7340c..b2408597e98f1 100644

extensions/libxt_MARK.man line 4

Quoted 6 lines
extensions/libxt_MARK.man +2 -2
@@ -1,7 +1,7 @@
 This target is used to set the Netfilter mark value associated with the packet.
 It can, for example, be used in conjunction with routing based on fwmark (needs
-iproute2). If you plan on doing so, note that the mark needs to be set in the
-PREROUTING chain of the mangle table to affect routing.
+iproute2). If you plan on doing so, note that the mark needs to be set in
+either the PREROUTING or the OUTPUT chain of the mangle table to affect routing.

You have two choices:

Quoted 6 lines
Quoted 4 lines

* Set the mark in filter OUTPUT chain => it does not affect routing.
* Set the mark in the mangle OUTPUT chain => it _does_ affect routing.

Are we on the same page?

Ah, I right I just re-read and it looks fine.

OK. :)

Thanks, Phil