Re: Policy routing (fwmark-based) and local traffic...

Florian Westphal <[email protected]> Tue, 30 Jul 2019 13:46:01 +0000
Newsgroups org.kernel.vger.lartc
Message-ID <[email protected]>
Marco Gaiarin <[email protected]> wrote:
> > Yes, however, mangle OUTPUT will re-route in case of fwmark change.
> 
> A-HA! Seemed a bit too strange to me... i've tried with:
> 
> 	iptables -t mangle -I OUTPUT -d $gip -p tcp -m multiport --dports ${TCP_PORTS} -m mark --mark 0/$MASK -j MARK --set-mark $MARK/$MASK

Works for me.

> and does not work; you say me that i've to use:
> 
> 	iptables -t mangle -I OUTPUT -d $gip -p tcp -m multiport --dports ${TCP_PORTS} -j MARK --set-mark $MARK/$MASK
> 
> (eg: ignore eventually 'implicit' mark set by the routing decision) to
> make it work?

Whats an implicit mark set by the routign decision?

> 're-route' happen automatically?

Yes, if mark or other attibutes (e.g. dscp) changed.