From: Florian Westphal Date: Tue, 30 Jul 2019 13:46:01 +0000 Subject: Re: Policy routing (fwmark-based) and local traffic... Message-Id: <20190730134601.iiywf6lpq2exaf64@breakpoint.cc> List-Id: References: <20190730123207.GE2430@sv.lnf.it> In-Reply-To: <20190730123207.GE2430@sv.lnf.it> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Marco Gaiarin 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.