Open dswaffordcw opened 5 months ago
Policy in gobgp.StartBgpRequest will be ignored if I remember correctly.
You could work around like the following:
s.SetPolicyAssignment(context.Background(), &api.SetPolicyAssignmentRequest{
Assignment: &api.PolicyAssignment{
Name: "global",
Direction: api.PolicyDirection_IMPORT,
DefaultAction: api.RouteAction_REJECT,
},
})
@fujita Thanks! SetPolicyAssignment()
works well.
If configuring a policy is not supported during startup, would you be open to a pull request to delete ApplyPolicy
from message Global
on https://github.com/osrg/gobgp/blob/master/api/gobgp.proto#L1109C1-L1109C33?
Or adding an error on startup if it's populated?
I prefer to add an error because I don't want to change the API without the major version updated.
Hi,
I am working with an existing GoBGP integration that uses the "v3 API", via a direct Go import. I am attempting to configure a default import policy over the API similar to the example shown in https://github.com/osrg/gobgp/blob/master/docs/sources/policy.md#42-attach-policy-to-route-server-client.
I am not seeing the expected result. This configuration should reject all announced BGP paths toward the GoBGP instance, yet they continue to be accepted and imported.
In https://github.com/osrg/gobgp/issues/1768#issuecomment-1839399167, I see another person reported the same issue with the V3 API on an old, closed, issue.
My code is as follows:
In the output below, I am observing the accepted/imported routes from the GoBGP instance using a custom CLI tool. This is a route that was announced to a remote FRR instance and then advertised into this GoBGP instance. It should have been rejected.