diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-02-19 15:40:30 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-02-29 15:59:42 -0800 |
commit | 0b78f57ccdf63591fd211ade0b571189e070f598 (patch) | |
tree | 0c92ff928bcd4aabb9735740f98da486686b051d /config | |
parent | 53c5bc0258cede44d3544270309b6dd2e83cf058 (diff) |
config/server: support per-peer asn
you can override `global.config.as` by `neighbor.config.local-as`
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config')
-rw-r--r-- | config/default.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/config/default.go b/config/default.go index fe7d547b..21b95758 100644 --- a/config/default.go +++ b/config/default.go @@ -131,8 +131,12 @@ func SetDefaultConfigValues(v *viper.Viper, b *Bgp) error { } } + if !vv.IsSet("neighbor.config.local-as") { + n.Config.LocalAs = b.Global.Config.As + } + if !vv.IsSet("neighbor.config.peer-type") { - if n.Config.PeerAs != b.Global.Config.As { + if n.Config.PeerAs != n.Config.LocalAs { n.Config.PeerType = PEER_TYPE_EXTERNAL } else { n.Config.PeerType = PEER_TYPE_INTERNAL |