-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pbr: T6430: Local IP rules targeting VRFs by name as well as route table IDs #3938
Conversation
👍 |
✅ No issues found in unused-imports check.. Please refer the workflow run |
d7dabbb
to
3058707
Compare
Rebased on current, it's been a little while... Basic functional checks on
|
I lost access to the router with this config:
Generated rules:
Check:
So need to be careful with VRF
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked, works fine in my tests
I'd say this was always a bit dangerous in local-route, would it be worthwhile me adding a warning for rules matching v4/v6 default routes and loopbacks? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any arguments against this, but this needs more reviews, of course.
@@ -113,6 +131,24 @@ | |||
</completionHelp> | |||
</properties> | |||
</leafNode> | |||
<leafNode name="vrf"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code is duplicate, can we move this to some file and use #include
* This is the `policy local-route*` part of T6430, manipulating ip rules, another PR covers firewall-backed `policy route*` for similar functionality * Local PBR (policy local-route*) can only target table IDs up to 200 and the previous PR to extend the range was rejected * PBR with this PR can now also target VRFs directly by name, working around targeting problems for VRF table IDs outside the overlapping 100-200 range * Validation ensures rules can't target both a table ID and a VRF name (internally they are handled the same) * Relocated TestPolicyRoute.verify_rules() into VyOSUnitTestSHIM.TestCase, extended to allow lookups in other address families (IPv6 in the new tests). verify_rules() is used by original pbr and new lpbr smoketests in this PR.
3058707
to
9c291d1
Compare
Change Summary
My previous PR for simply extending the table ID range was rejected, so I've prepared another PR set closer to my own use case for this - "policy based route leaking" between VRFs. It may or may not line up with Bernhard's intention from the original ticket.
This PR extends
policy local-route
syntax to allowset vrf
as well asset table
.The main PR for firewall-driven forward PBR has already been merged, this one covers local
ip rule
manipulation.Types of changes
Related Task(s)
Related PR(s)
Component(s) name
Proposed changes
policy local-route*
part of T6430, manipulating ip rules, another PR covers firewall-backedpolicy route*
for similar functionalitypolicy local-route
functionalityHow to test
Rules apply OK:
Smoketest result
Since I changed the
policy route
smoketests and the parent shim, I ran through both smoketests to double check:Checklist: