diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-26 21:40:16 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-26 21:40:16 +0900 |
commit | d9cbb32c3e917d5a208e58f49785da8fe3863e1c (patch) | |
tree | e0a6460b9ca9c935ab2f947be74185f98e3aa6e2 /gobgpd | |
parent | 96002fd5c4344579b998558b3ad5f929b23ee650 (diff) |
server: add zebra api support to configure linux network stack
Install route information to linux network stack via quagga's zebra.
$ gobgpd --enable-zapi
By default, 'unix:/var/run/quagga/zserv.api' for is used for zapi
endpoint. It's not the case in your environment, use '--zapi-url'
option.
Note that only ipv4 support now.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd')
-rw-r--r-- | gobgpd/main.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go index 62503d50..89cd0cb8 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -44,6 +44,8 @@ func main() { UseSyslog string `short:"s" long:"syslog" description:"use syslogd"` Facility string `long:"syslog-facility" description:"specify syslog facility"` DisableStdlog bool `long:"disable-stdlog" description:"disable standard logging"` + EnableZapi bool `short:"z" long:"enable-zapi" description:"enable zebra api"` + ZapiURL string `long:"zapi-url" description:"specify zebra api url"` } _, err := flags.Parse(&opts) if err != nil { @@ -146,6 +148,17 @@ func main() { grpcServer := server.NewGrpcServer(server.GRPC_PORT, bgpServer.GrpcReqCh) go grpcServer.Serve() + if opts.EnableZapi == true { + if opts.ZapiURL == "" { + opts.ZapiURL = "unix:/var/run/quagga/zserv.api" + } + err := bgpServer.NewZclient(opts.ZapiURL) + if err != nil { + log.Error(err) + os.Exit(1) + } + } + var bgpConfig *config.Bgp = nil var policyConfig *config.RoutingPolicy = nil for { |