summaryrefslogtreecommitdiffhomepage
path: root/config/default.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-05-05 12:30:32 -0400
committerWataru Ishida <ishida.wataru@lab.ntt.co.jp>2017-05-10 08:15:00 +0000
commit9b9a65d410bbf35730f4970932c7688203e096b1 (patch)
tree5a539d40d6190c20341ae7e5c4827e2c0bd532e2 /config/default.go
parent1f053c25c423c79471fbe1d5fb6c618bb67409df (diff)
*: 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 <neighbor-addr> as <asn> replace-peer-as ``` config ``` neighbor: config: peer-as: <asn> neighbor-address: <neighbor-addr> as-path-options: config: replace-peer-as: true ``` Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config/default.go')
-rw-r--r--config/default.go4
1 files changed, 4 insertions, 0 deletions
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