I’ve been tinkering and breaking things so I thought I’d raise a hand for some guidance…
I think I want to use policy-based routing to direct traffic destined for a particular subnet to use a specific routing table. It seems like I have to set interfaces <interface> <name> policy route <name>
to assign the policy to the ingress interfaces that the policy should apply to — but I’m not sure this is exactly what I want to do.
This is for integrating with AMPRNET, for anyone curious. The destination subnet is (for simplicity) 44.0.0.0/8. All traffic to that subnet should egress on a tunnel interface. I have a custom binary tool that listens for RIP broadcasts from AMPRNET and adds routes directly to either the main table or a table I can specify. I have all this working just fine, if I send the routes to the main table. That’s not really a problem, but it seems untidy. And I want to understand better how to work with routing tables and PBR.
So let’s say I configure the external tool to add those routes to table 44. I want traffic originating from any interface and destined for 44.0.0.0/8 to be routed according to table 44.
I can do that with:
set policy route AMPRNET rule 10 destination address 44.0.0.0/8
set policy route AMPRNET rule 10 set table 44
But I’m not sure where to proceed from here.
Do I need to assign this policy to every single other interface? (Somehow this doesn’t seem right to me)
If I do, will those interfaces use the main table for all other destination subnets? Do I need to specify some other rule(s) to direct all other traffic to the main table?
Is there a different/better approach whereby I can have the policy applied globally, without having to set it for every interface?
Thanks for any insights.