From 9b9a65d410bbf35730f4970932c7688203e096b1 Mon Sep 17 00:00:00 2001 From: Wataru Ishida Date: Fri, 5 May 2017 12:30:32 -0400 Subject: *: support replace-peer-as (aka as-override) we use the term replace-peer-as instead of as-override since openconfig is using it. cli ``` $ gobgp n add as replace-peer-as ``` config ``` neighbor: config: peer-as: neighbor-address: as-path-options: config: replace-peer-as: true ``` Signed-off-by: Wataru Ishida --- config/default.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config') diff --git a/config/default.go b/config/default.go index cfa3a722..cafe19ae 100644 --- a/config/default.go +++ b/config/default.go @@ -103,12 +103,16 @@ func setDefaultNeighborConfigValuesWithViper(v *viper.Viper, n *Neighbor, asn ui n.Config.PeerType = PEER_TYPE_EXTERNAL n.State.PeerType = PEER_TYPE_EXTERNAL n.State.RemovePrivateAs = n.Config.RemovePrivateAs + n.AsPathOptions.State.ReplacePeerAs = n.AsPathOptions.Config.ReplacePeerAs } else { n.Config.PeerType = PEER_TYPE_INTERNAL n.State.PeerType = PEER_TYPE_INTERNAL if string(n.Config.RemovePrivateAs) != "" { return fmt.Errorf("can't set remove-private-as for iBGP peer") } + if n.AsPathOptions.Config.ReplacePeerAs { + return fmt.Errorf("can't set replace-peer-as for iBGP peer") + } } n.State.PeerAs = n.Config.PeerAs -- cgit v1.2.3