Skip to content
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

Natively modify host route table #2615

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

GSGBen
Copy link
Contributor

@GSGBen GSGBen commented Jan 7, 2023

This pull request provides experimental functionality to inject learned routes into the routing table of the host running GoBGP. i.e. it provides a subset of something like Zebra's functionality without requiring the external dependency of Zebra.

The reference implementation provided is for Windows, but it's structured using the existing <filename>_<platform>.go pattern so it can be extended to other platforms. The implementation and flow mirrors the Zebra integration for consistency.

Config is under a new top-level experimental level to emphasize to users this isn't mainline functionality. Documentation heavily emphasizes this too.

Documentation is provided on usage, architecture/flow, and how to extend, in docs/sources/modify-host-fib.md.

I've tested this on Windows 10 with adds, updates, deletes, cleanup-on-shutdown (not sure if the existing Zebra integration does this but I wanted it), and a reasonably sized BGP topology - all is working. I haven't added any tests to CI/CD as GitHub Actions doesn't work well (or at all) with Windows containers. If in the future someone adds Linux support, it would be easy to add tests for that using the existing test structure you have because each container will have a route table you can check.

For Windows route table support I've added a dependency on wireguard-go, which exposes Windows route table APIs in a clean way. Wireguard-go is a well known and trusted project.

@fujita
Copy link
Member

fujita commented Jan 7, 2023

I like the idea of playing with the routing table in operating systems directly but I'm not sure about the needs for running GoBGP in Windows with this feature. It's very difficult to maintain a feature that few people need.

@GSGBen
Copy link
Contributor Author

GSGBen commented Jan 7, 2023

That's a good point.

In the documentation I've mentioned This is not supported by the core GoBGP team at all. Use at your own risk. Would it work if under that I added

Additionally, the Windows implementation is not maintained by the core GoBGP team. Issues regarding the Windows implementation, and all modify-host-fib functionality will be closed.

Then you won't have any additional maintenance burden.

@sc68cal
Copy link

sc68cal commented Jan 16, 2023

I would like to see more support for GoBGP doing native route table manipulation, since having to split configuration between GoBGP and Zebra was somewhat annoying. It would be great to be able to configure all of it in a single place, instead of juggling route maps in two different components.

@olljanat
Copy link

I like the idea of playing with the routing table in operating systems directly but I'm not sure about the needs for running GoBGP in Windows with this feature. It's very difficult to maintain a feature that few people need.

@fujita is there some reason why it have not been implemented but instead of GoBGP is relying for Zebra?

As far I see, it is actually quite simple to create and remove local routes with https://github.com/vishvananda/netlink ( RouteAdd and RouteDel functions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants