BalanceNG Cheatsheet

Under shell

Start BalanceNG

# bng start        (start default instance 0, using the config file bng.conf)
# bng start 21   (start instance 21, using the config file bng21.conf)
# bng -I         Show info. of all instances . (Running or Off)
# bng -N         Show node id
# bng -d <start/stop/status...>
                                  Open debug mood

Open the interactive mode of BalanceNG

# bng control
BalanceNG: connected to PID 3066
# bng control 21  (admin interface for instance 21)
BalanceNG: connected to PID 3066

In BNG control

Here list some most frequently used command. Detail please refer to the user manual.
Check current active configurations with in one instance. The servers and the targets.
show conf <section>
     show conf target 1
     show conf network
show ifstat
show parameters
show arphash
show machash
show ifstat

Complete list:

  arp <ip4>                      declare IP address to be ARP-resolved
  benchmark <ifsend> <ifrcv>     perform BalanceNG loopback benchmark
  check                          perform configuration check
  commit <item> <number(s)>      register and enable networks/servers/targets
  disable <item> <number(s)>     disable networks/servers/targets
  dump <if> <dir>                pcap dump traffic on <if> to <dir>
  edit <item> <numbers>          disable+unregister networks/servers/targets
  enable <item> <number(s)>      enable networks/servers/targets
  gateway <ip4>                  specify default gateway ipaddress (old syntax)
  gateway ipaddr <ip4>           specify default gateway ipaddress
  help                           display this information
  help <topic>                   display topic specific information, ? for list
  hostname <name>                specify name of this BalanceNG instance
  interface <if>                 make interface <if> available for BalanceNG
  ipdb [<file.csv>]              load IPDB from .csv file
  l2switch                       enable layer 2 switching
  license <serno> <key>          specify serno and license key
  locate <addr>                  lookup IP address in current IPDB
  network <idx> <cmd> <value>    modify network <idx>, see "help network"
  no <command>                   revert command
  register <item> <number(s)>    register networks/servers/targets
  remark <remark>                specify configuration remarks
  save                           shorthand for "save conf"
  save conf                      save current configuration
  save private                   save private configuration data
  save all                       save configuration and private data
  server <idx> <cmd> <value>     modify server <idx>, see "help server"
  sessiondump <file>             dump all sessions to file
  set <parameter> <value>        set parameter to specific value
  show <item>                    show item, show ? for item list
  shutdown                       alias for stop
  snapshot <file>                collect all relevant service data in file
  softdisable target <number(s)> don't create new sessions for target(s)
  stop                           stop background process and exit
  target <idx> <cmd> <value>     modify target <idx>, see "help target"
  tnat <ip4a> <ip4b> <pr> <prt>  target NAT for outbound communications
  unregister <item> <number(s)>  unregister networks/servers/targets
  vip <ip4>                      represent VIP using ARP
  vrrp <sc> <value>              vrrp settings, see "help vrrp"

Echo bng

It's also possible to pipe a command into BalanceNG invoked with "bng control" like this:

# echo "show targets" | bng control
bng# show targets
# ipaddr port prt net srv sessions status name
1 any any 1 1 0 operational

Different instances

Can have same nodeid  --> One license
Can have same targets
Should have different virtural server address
Should have different real  IP