-
Notifications
You must be signed in to change notification settings - Fork 92
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
Added redistribute live and check_xroutes #114
base: master
Are you sure you want to change the base?
Added redistribute live and check_xroutes #114
Conversation
The router id allows to assign origin-based pref-src. A use case is, when installing default routes originated by two edge routers with different subnets, and the client has 2 ips matching the separate subnets install ip 0.0.0.0/0 eq 0 id 00:02:00:00:00:00:1d:01 pref-src 66.199.5.163 install ip 0.0.0.0/0 eq 0 id 00:02:00:00:00:00:1d:00 pref-src 12.144.66.186
When two similar routes with pref-src were switched, the pref-src was not updated to the new one. With this fix, switch_routes passes the new->src to change_route, which is used to reapply the install_filter and retrieve the newpref_src from the filter_result. kernel_route for netlink has been updated to support the newpref_src on ROUTE_MODIFY
It allows to change the metric of an existing redistribute filter using the live config
Allows to send an update of a redistribute metric changed to INFINITY It adds a command check_xroutes that does not ignore the INFINITY metric of kernel routes
Thanks for the PR. Sorry for the delay, you submitted it at a bad time and then it fell into the cracks. At first sight it looks good, please give me a few days to review it carefully. |
No problem, if interested after these commits I added a multi default support, however it is a more pervasive change and to work requires policy rules and to install the multiple default routes in separate tables Also have a few changes to support table id > 255 and a delay on first update when using hmac to after the cycle is running and the handshake is completed I am on hold currently on the project but I will use it to upgrade our network to multi-isp clos model |
I've applied the first two patches of your PR. In the third patch, I have a problem: why is applying the install filter conditional on newsrc being non-null? I think that's a bug, we should be applying the install filter unconditionally in change_route and flushing the route if the install_filter causes it to be discarded. The fourth patch is incomplete. It only works in a very specific case (the filter already exists and only the add_metric field is being changed), which is fine, no problem only doing the specific case that solves your problem. However, if the requested operation could not be performed, it does not return an error message to the user. As to the last patch, I don't understand why it is useful. It also generates an error message that does not fit the established pattern (error messages start with either "no" or "bad"). |
3rd patch: Only in 4th patch: Yes, I handled not finding the filter as a noop, the update filter was meant for that very specific case, but I could add a fail return message 5th patch: It is needed to send the metric change update when the route is changed to deny. Before patch, redistribute filters are fixed once the configuration is read, so |
Agreed, but I think that the existing code is buggy in case of a non-trivial install filter. I could be wrong, but I think we need to invoke install_filter unconditionally in switch_routes.
You really need to add proper error handling there.
Hmm. First of all, it's not strictly needed, since the routes will still expire. However, it might take some time. I'm not keen on adding a manual trigger. Can we work things out so that the update happens automatically? |
Done
A first option could be to trigger
Another option could be to remove the infinity check altogether from: Line 491 in 130366f
Then at kernel-check-interval timeout the new metric would be detected and update sent instead of ignored
The kernel default routes are never touched, as they are used by a timed external script to check if internet is available, only the redistribution parameter in babel is changed. So there is no kernel netlink update to use to trigger an update. |
I was unable to reliably make the fake default route IPv4 and IPv6 on dev lo work. For example, sometimes babeld on the distributing server was setting the xroute metric to unreachable even if it was ok, and only at one of ipv4 or ipv6.
Result was that the client would get, with another default route retracted, one of ipv4 or ipv6 completely unreachable
I am not sure what was causing the metric not reflect the state, but I suppose it was having 2 default routes on the same master table
Using redistribute live update + check_xroutes I was able to have consistent results of refmetric on the client with any combination or order of default routes working or not