The bng Command

 


The bng Command #

Usage #

$ sudo bng

      This is BalanceNG 7.543 Debian13-amd64 (2026/07/21)

  Copyright (C) 2005-2025,2026 by Inlab Networks GmbH, Germany.
         All rights reserved / Alle Rechte vorbehalten.
              further information: bng.inlab.net

  usage: bng [-df] start|stop|restart|status|control [instance]

$

bng command [instance] #

bng start [instance] #

This starts a BalanceNG instance in the background as a daemon. BalanceNG reads as a first step the configuration for that instance (if it exists) and commences with its operation. If the optional instance parameter is omitted, the default instance 0 is assumed and started. Alternatively, a specific instance can be specified with the second argument.

Example (starting the default instance 0):

$ sudo bng start
BalanceNG: starting up ...
$

Example (starting instance number 41):

$ sudo bng start 41
BalanceNG: starting up instance 41 ...
$ sudo bng stop 41
BalanceNG: shutdown of instance 41 PID 74926 complete
$

If there’s already a BalanceNG instance running on this machine, the output may look as follows:

$ sudo bng start
BalanceNG: already running with PID 7914
$

bng stop [instance] #

This stops a BalanceNG instance, the output may look like this:

$ sudo bng stop
BalanceNG: shutdown of PID 7914 complete
$ sudo bng stop 41
BalanceNG: shutdown of instance 41 PID 27231 complete
$

bng restart [instance] #

This restarts a BalanceNG instance and is equivalent to execute “bng stop” and “bng start” consecutively.

Example:

$ sudo bng restart
BalanceNG: shutdown of PID 7919 complete
BalanceNG: starting up ...
$ sudo bng restart 41
BalanceNG: shutdown of instance 41 PID 27419 complete
BalanceNG: starting up instance 41 ...
$

bng reload [instance] #

This allows to reload the configuration file and potentially updated server / target relationships on the current VRRP master. Not affected session table entries are maintained.

A reload fails, if there are any changes to the network and VRRP sections or to the set parameter section (and a bng restart is required immediately afterwards).

In that case the error message ERROR: was unable to reload, restart required. is reported to the log.

This invocation is equivalent to execute a “reload” command in the “bng control” CLI.

Example:

$ sudo bng reload
$

bng [-e] control [instance] #

This invokes the interactive configuration mode (the bng control CLI) of a BalanceNG instance, bng control may be abbreviated as bng ctl.

If the option -e is specified, this command exits with EX_TEMPFAIL if the same command frontend is already running.

Typing EOF (Ctrl-D) exits the interactive configuration mode.

The interactive configuration mode allows simple command line editing using the arrow-keys. This is only active is an interactive terminal is detected on stdin, otherwise the command line editing option is switched off to allow automated programs to operate on the command line.

Since only one single command channel can be active at a time, the following two additional command channels are also available (providing the same functionality):

  • bng [-e] auxctl [instance]
  • bng [-e] cmdctl [instance]
$ sudo bng control
BalanceNG: connected to PID 7928
bng#
...

$ sudo bng restart 41
BalanceNG: not yet running
BalanceNG: starting up instance 41 ...
$ sudo bng control 41
BalanceNG: connected to instance 41 PID 27479
bng#
...

bng status [instance] #

This provides information about the current state of a BalanceNG instance.

Example:

$ sudo bng status
BalanceNG: running with PID 7921
$ sudo bng stop
BalanceNG: shutdown of PID 7921 complete
$ sudo bng status
BalanceNG: not running
$

$ sudo bng status 41
BalanceNG: instance 41 running with PID 27423
$ sudo bng stop 41
BalanceNG: shutdown of instance 41 PID 27423 complete
$ sudo bng status 41
BalanceNG: instance 41 not running
$

bng -option #

There are a few bng command line options available, some of them are modifying the execution of a bng command in a way and others perform a specific action by themselves.

Option Description Example
-N show nodeid $ sudo bng -N
-V show vnodeid $ sudo bng -V
-I list all instances and their status $ sudo bng -I
-M show instance MAC address $ sudo bng -i 1 -M
-d enable debug mode $ sudo bng -d start
-e exit with EX_TEMPFAIL on active bng control $ sudo bng -e control
-f stay in foreground $ sudo bng -df start
-i specify instance as an option $ sudo bng -i 1 -M