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

Grant Taylor <[email protected]> Wed, 31 Jul 2019 01:34:42 +0000
Newsgroups org.kernel.vger.lartc
Message-ID <[email protected]>
On 7/30/19 6:32 AM, Marco Gaiarin wrote:
> I was trying to setup some policy routing (using iptables fwmark) 
> for local traffic; i've just in place rules for forward traffic 
> (in PREROUTING chain, mangle table) and works as expected.

Please provide a high level overview of why you are wanting to use PBR. 
What is the purpose behind the policies?  It looks like you might be 
wanting to cause traffic to / from specific IPs to use different routes 
from the system default.

If that is the simple case, I'd be tempted to see if the l3-mdev can do 
what you are wanting to do.  I.e. put the interface(s) associated with 
FIBRA into one l3-mdev, put the interface(s) associated with ADSL2 into 
another l3-mdev, and leave the rest of the interface(s) alone.

L3-mdev will cause any traffic from the associated interfaces to use the 
associated routing tables.  It might mean that you don't need to worry 
about this yourself.

I'm also curious to have an idea of what's in your FIBRA, ADSL2, main, 
and default routing tables.

> It is true or i'm missing something? Thanks.

Maybe.  I can't tell if l3-mdev would be a good fit for your use case or 
not.



-- 
Grant. . . .
unix || die
smime.p7s (application/pkcs7-signature, 3.9 KB) - not displayed