0

Am trying to learn using policy based routing which is based on fwmark as below. Need to forward traffic by using default entry in table1, if table1 doesnt have a default entry, then that particular traffic should be dropped.

But with the below config, if there is no entry in table1, the traffic is using default entry in main table, but I expect a drop in that case.

[root@~]# ip rule
0:  from all lookup local 
32764:  from all fwmark 0x1000000 lookup table1 
32766:  from all lookup main 
32767:  from all lookup default 

[root@~]# ip route list table table1
default via 10.10.10.10 dev port1
**if table1 empty then** 
default via dev DROP_INTERFACE

How do I add this default drop route in custom "table1", My thought is to create a virtual dummy drop interface, which I will set as default & which will blackhole the traffic.

Any other suggestions ?

0

You can try create a 'table2', pref 32765. 'table2' have a blackhole route.

Look like this:

0: from all lookup local

32764: from all fwmark 0x1000000 lookup table1

32765: from all fwmark 0x1000000 lookup table2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.