Tender Apprentice
Joined: 05 Nov 2005 Posts: 166
|
Posted: Sat Dec 05, 2020 11:21 am Post subject: nftables rules optimizations |
|
|
Hello,
I would like to have an hint about these rules:
Code: | iifname "enp1s0.511" mark set mark or 1
iifname "enp1s0.512" mark set mark or 2
iifname "enp1s0.513" mark set mark or 4
iifname "enp1s0.514" mark set mark or 8
iifname "enp1s0.51*" ip daddr {192.168.0.0/28,192.168.2.0/24,192.168.11.0/24,192.168.13.0/24,192.168.14.0/24} mark set mark and 0 |
These rules work, I use them to route different vlans traffic from/to internet towards different ppp interfaces, leaving the intra vlan traffic routed locally.
I am wondering if there is an easier way to achieve the same result using specific nft directives.
For example, using fib statement like (exists nftrace set 1 is only a dummy placeholder):
Code: | fib daddr . iif oif exists nftrace set 1 |
The search on the internet was fruitless, and the nft documentation describes well all the individual components of the syntax but, at least as far as I'm concerned, it doesn't help me to understand if and how there is a more adequate alternative.
Thanks |
|