diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go index 77c6d8fb..7efc3686 100644 --- a/server/server.go +++ b/server/server.go @@ -2652,6 +2652,12 @@ func (server *BgpServer) handleAddNeighborRequest(grpcReq *GrpcRequest) ([]*Send if a.Transport != nil { pconf.Transport.Config.LocalAddress = a.Transport.LocalAddress pconf.Transport.Config.PassiveMode = a.Transport.PassiveMode + } else { + if net.ParseIP(a.Conf.NeighborAddress).To4() != nil { + pconf.Transport.Config.LocalAddress = "0.0.0.0" + } else { + pconf.Transport.Config.LocalAddress = "::" + } } if a.EbgpMultihop != nil { pconf.EbgpMultihop.Config.Enabled = a.EbgpMultihop.Enabled |