diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-10 15:43:41 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-11 05:44:30 +0900 |
commit | d4a82f70ba17b64b1841d801098bf38dc0c475e1 (patch) | |
tree | f4a03088be1d1a11432cd539a28e727c9e4d3192 /gobgpd | |
parent | 0d2633e7831cb2406bacf62a232fcca7184ff988 (diff) |
specify api hosts that gobgpd listens on
by default, ":50051" is used as before.
gobgpd accepts grpc connections from localhost with the following
example:
$ gobgpd --api-hosts 127.0.0.1:50051
You can specify multiple hosts like:
$ gobgpd --api-hosts 127.0.0.1:50051,10.0.255.254:50051
close #796
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'gobgpd')
-rw-r--r-- | gobgpd/main.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gobgpd/main.go b/gobgpd/main.go index b41b72d9..f6788cab 100644 --- a/gobgpd/main.go +++ b/gobgpd/main.go @@ -49,7 +49,7 @@ func main() { DisableStdlog bool `long:"disable-stdlog" description:"disable standard logging"` CPUs int `long:"cpus" description:"specify the number of CPUs to be used"` Ops bool `long:"openswitch" description:"openswitch mode"` - GrpcPort int `short:"g" long:"grpc-port" description:"grpc port" default:"50051"` + GrpcHosts string `long:"api-hosts" description:"specify the hosts that gobgpd listens on" default:":50051"` GracefulRestart bool `short:"r" long:"graceful-restart" description:"flag restart-state in graceful-restart capability"` Dry bool `short:"d" long:"dry-run" description:"check configuration"` } @@ -174,7 +174,7 @@ func main() { go bgpServer.Serve() // start grpc Server - grpcServer := server.NewGrpcServer(opts.GrpcPort, bgpServer.GrpcReqCh) + grpcServer := server.NewGrpcServer(opts.GrpcHosts, bgpServer.GrpcReqCh) go func() { if err := grpcServer.Serve(); err != nil { log.Fatalf("failed to listen grpc port: %s", err) |