Skip to content

Natively modify host route table#2615

Open
GSGBen wants to merge 10 commits intoosrg:masterfrom
GSGBen:1-inject-received-routes-into-the-windows-routing-table
Open

Natively modify host route table#2615
GSGBen wants to merge 10 commits intoosrg:masterfrom
GSGBen:1-inject-received-routes-into-the-windows-routing-table

Conversation

@GSGBen
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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).

@fujita
Copy link
Copy Markdown
Member

fujita commented Jul 16, 2025

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).

What about non-Linux OSes?

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