diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2017-05-05 11:19:40 -0400 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2017-05-10 08:05:47 +0000 |
commit | 1f053c25c423c79471fbe1d5fb6c618bb67409df (patch) | |
tree | ba3c43da6df3e1163a754ff742f25a64d819d6e2 /config/default.go | |
parent | 540d77319c6eaa1eefd7b52df2a4771c7ee565ac (diff) |
*: support remove private as
cli
```
$ gobgp n add <neighbor-addr> as <asn> remove-private-as (all|replace)
```
config
```
neighbor:
config:
peer-as: <asn>
neighbor-address: <neighbor-addr>
remove-private-as: all
```
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config/default.go')
-rw-r--r-- | config/default.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/default.go b/config/default.go index 41990e95..cfa3a722 100644 --- a/config/default.go +++ b/config/default.go @@ -102,9 +102,13 @@ func setDefaultNeighborConfigValuesWithViper(v *viper.Viper, n *Neighbor, asn ui if n.Config.PeerAs != n.Config.LocalAs { n.Config.PeerType = PEER_TYPE_EXTERNAL n.State.PeerType = PEER_TYPE_EXTERNAL + n.State.RemovePrivateAs = n.Config.RemovePrivateAs } 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") + } } n.State.PeerAs = n.Config.PeerAs |