diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-04-01 21:22:11 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-04-02 16:01:29 +0900 |
commit | ccdc2e6277020e571da7792c1d9e76cf13e82f44 (patch) | |
tree | c3df5db11d72ec9a2314ba41bfccc9ea9fd47feb /internal/pkg/config | |
parent | 805d02fdfbc5092ef7a676b1c3a63dfb32571b47 (diff) |
add secondary-route feature for router server
if an export policy rejects a selected route, try the next route in
order until one that is accepted is found or all routes for the peer
are rejected.
the default is disabled. You can enable this feature in the following
way:
[neighbors.route-server.config]
route-server-client = true
secondary-route = true
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'internal/pkg/config')
-rw-r--r-- | internal/pkg/config/bgp_configs.go | 15 | ||||
-rw-r--r-- | internal/pkg/config/util.go | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/internal/pkg/config/bgp_configs.go b/internal/pkg/config/bgp_configs.go index f5a8215b..8dee732d 100644 --- a/internal/pkg/config/bgp_configs.go +++ b/internal/pkg/config/bgp_configs.go @@ -2020,6 +2020,12 @@ type RouteServerState struct { // gobgp:route-server-client's original type is boolean. // Configure the neighbor as a route server client. RouteServerClient bool `mapstructure:"route-server-client" json:"route-server-client,omitempty"` + // original -> gobgp:secondary-route + // gobgp:secondary-route's original type is boolean. + // if an export policy rejects a selected route, try the next route in + // order until one that is accepted is found or all routes for the peer + // are rejected. + SecondaryRoute bool `mapstructure:"secondary-route" json:"secondary-route,omitempty"` } // struct for container gobgp:config. @@ -2030,6 +2036,12 @@ type RouteServerConfig struct { // gobgp:route-server-client's original type is boolean. // Configure the neighbor as a route server client. RouteServerClient bool `mapstructure:"route-server-client" json:"route-server-client,omitempty"` + // original -> gobgp:secondary-route + // gobgp:secondary-route's original type is boolean. + // if an export policy rejects a selected route, try the next route in + // order until one that is accepted is found or all routes for the peer + // are rejected. + SecondaryRoute bool `mapstructure:"secondary-route" json:"secondary-route,omitempty"` } func (lhs *RouteServerConfig) Equal(rhs *RouteServerConfig) bool { @@ -2039,6 +2051,9 @@ func (lhs *RouteServerConfig) Equal(rhs *RouteServerConfig) bool { if lhs.RouteServerClient != rhs.RouteServerClient { return false } + if lhs.SecondaryRoute != rhs.SecondaryRoute { + return false + } return true } diff --git a/internal/pkg/config/util.go b/internal/pkg/config/util.go index 2c2a78c8..78a0e713 100644 --- a/internal/pkg/config/util.go +++ b/internal/pkg/config/util.go @@ -522,6 +522,7 @@ func NewPeerFromConfigStruct(pconf *Neighbor) *api.Peer { }, RouteServer: &api.RouteServer{ RouteServerClient: pconf.RouteServer.Config.RouteServerClient, + SecondaryRoute: pconf.RouteServer.Config.SecondaryRoute, }, GracefulRestart: &api.GracefulRestart{ Enabled: pconf.GracefulRestart.Config.Enabled, @@ -587,6 +588,7 @@ func NewPeerGroupFromConfigStruct(pconf *PeerGroup) *api.PeerGroup { }, RouteServer: &api.RouteServer{ RouteServerClient: pconf.RouteServer.Config.RouteServerClient, + SecondaryRoute: pconf.RouteServer.Config.SecondaryRoute, }, GracefulRestart: &api.GracefulRestart{ Enabled: pconf.GracefulRestart.Config.Enabled, |