Administrative and informational bng CLI Commands #
These bng CLI commands either provide information or are for administrative purposes. They all have in common that they do not change or alter the active bng configuration of the current instance.
arp-insert #
Synopsis: arp-insert <ip-address> <mac-address>
This command allows to insert an ARP/ND6 entry for testing purposes only. This makes it possible to simulate the presence of a target.
Example:
bng# arp-insert ::ffff:172.16.30.26 00:50:56:ab:6e:97
bng#
benchmark #
Synopsis: benchmark <send-if> <rcv-if>
This functionality and command is no longer so important as it once was. Mainly, it tests only the single threaded scheduler (which is off by default) and secondly modern Linuxes on modern hardware are no longer a possible bottleneck, even with 10GbE NIC’s.
This command executes a hardware, OS and network benchmark in the background controlled by the parameters “bmduration”, “bmpsize” and “bmwsize” (see “set” command below). The results and/or status can be shown with “show benchmark”.
This command requires the “benchmark” module being loaded (“module benchmark”). Please note that the benchmark functionality is less efficient than the operation of BalanceNG in multithreading mode, for measuring real packet processing performance of a production configuration this needs to be performed using other external testing tools.
Example:
bng# module benchmark
bng# interface eth0
bng# interface eth1
bng# benchmark eth0 eth1
bng# show benchmark
benchmark active and running:
duration (seconds) : 300
packetsize : 1514
window size : 16
packets sent : 212921
packets received : 212905
seconds remaining : 294
bng# show benchmark
benchmark finished with the following results:
duration (seconds) : 300
packetsize : 1514
window size : 16
packets sent : 10797158
packets received : 10797142
lost packets : 0
packets per second : 35990
bytes per second : 54489577
bng#
bngsynctest #
Synopsis: bngsynctest <subtype>
This command allows to test the generation of bngsync protocol packets. Only the subtype needs to be specified, ranging from 4 to 8 (including) as specified. The IPv4/IPv6 protocol choice is determined by the type of the network <n> syncpeer
setting of the network being referenced by the VRRP section.
The generated packets contain the subtype 0x01 (1) instead of 0x00 (0) in order to faciliate automatic testing.
The source and destination port is taken from the bngsyncport
parameter (default 10439).
The destination address is the network <n> syncpeer
address and the source address is either the network <n> real
or network <n> real6
address (for IPv4 or IPv6, respectively).
bngsyncudptest #
Synopsis: bngsyncudptest <network> <string>
This command allows to test the basic generation of UDP packets for the bngsync protocol. It uses UDP over IPv4 or IPv6 depending of the syncpeer address type of the specified network index.
The source and destination port is taken from the “bngsyncport” parameter (default 10439) and the specified ASCII data is the variable length data portion of the UDP packet (and thus they are not bngsync protocol messages).
The destination address is the network <n> syncpeer
address and the source address is either the network <n> real
or network <n> real6
address (for IPv4 or IPv6, respectively).
This command is for automatic and manual testing only and should not be used on a live BalanceNG installation.
check #
Synopsis: check
A check of the current active configuration is performed. This is especially targeted towards the configuration of Servers and Targets. A warning is being issued at the following conditions:
- A Target is references by multiple Servers
- A Target is enabled, but not referenced at all
This function is implicitly called when Servers or Targets are entering the enabled state.
Example (with no warnings):
bng1# check
bng1#
Example (with warnings):
bng1# check
WARNING: target 1 already referenced from server 1
WARNING: target 1 reference from server 8 ignored
WARNING: target 2 already referenced from server 1
WARNING: target 2 reference from server 8 ignored
bng1#
clear #
Synopsis: clear <item>
This command clears counters which are maintained for informational purposes. “clear ?” shows a list of supported items like in this Example:
bng# clear ?
available items:
locationcounters IPDB location counters
bng#
Currently there’s only the item locationscounters
in the list of clearable items.
clear locationcounters
clears the counters which are shown by the show locations
command. A typical dialog may look like this:
bng# clear locationcounters
bng# show locations
key counter description
--- -------- ------------------------------------
AD ANDORRA
AE UNITED ARAB EMIRATES
AF AFGHANISTAN
...
YT MAYOTTE
ZA SOUTH AFRICA
ZM ZAMBIA
ZW ZIMBABWE
- *** NOT FOUND PSEUDO ENTRY ***
--- -------- ------------------------------------
235 0 total
bng#
coredump #
Synopsis: coredump
This command dereferences a NULL pointer in the BalanceNG main thread and thus initiates a core dump to be written (if the OS settings allow this).
This command if for debugging purposes only.
event
#
Synopsis: event <event-id>
This command records the occurrence of an event with the specified event-id in the session table. An event-id is an arbitrary text with a maximum length of 60 characters. The session-id has internally a leading ‘#’ character in order to distinguish the event type session table entries in the session table.
The number of occurrences of an event is internally kept in the “server” column of the session table entry, the point of time since this particular number of occurrences were recorded is kept in the “target” column.
This command is useful for testing the event handling.
Example:
bng# event test123
bng# event test123
bng# show sessions
1 session
srv tgt age timeout ftimeout SYNC session-id
----- ----- ----- ------- -------- ---- ------------------
2 3480 4 600 0 #test123
bng#
evcount
#
Synopsis: evcount <event-id>
This command displays the currently kept number of occurrences of the specified event.
Example:
bng# evcount test123
8
bng#
evfix #
Synopsis: evfix <event-id>
This command fixes the specified event in the session table with all its parameters (thus it will be never reclaimed by the session table garbage collection). This command is intended for testing the event handling system and functionality.
Example:
bng# event test123
bng# evfix test123
bng# show sessions
1 session
srv tgt age timeout ftimeout SYNC session-id
----- ----- ----- ------- -------- ---- ------------------
1 12 fixed 600 0 #test123
bng#
evrate #
Synopsis: evrate <event-id>
This command displays the current rate per second of the occurrences of the specified event. The internal count and time interval values are recalculated for this event if necessary. If the specified event has never occurred (or is no longer kept in the session table) the shown value is 0 (as expected).
Example:
bng# evrate test123
4
#bng
evtime #
Synopsis: evtime <event-id>
This command displays the currently kept time interval for the counting of the specified event (in seconds from the past until now).
If the specified event has never occurred the value 1 is shown (as returned by the internal functionality).
Example:
bng# evtime test123
392
bng#
evunfix #
Synopsis: evunfix <event-id>
This command unfixes the specified event in the session table by setting the internal age (or time of birth) to the current uptime.
This command is intended for testing the event handling system and functionality.
Example:
bng# evunfix test123
bng#
help #
Synopsis: help
Displays the main help information about available commands.
Example:
bng# help
available commands, type EOF (^D) to exit:
arp <IP-address> declare IP address to be ARP-resolved
benchmark <ifsend> <ifrcv> perform BalanceNG loopback benchmark
bngsynctest <subtype> send bngsync test messages type 0x01
bngsyncudptest <n> <string> bngsync basic UDP generation testing function
check perform configuration check
clear <item> clear counter (type "clear ?" for help)
commit <item> <number(s)> register and enable networks/servers/targets
coredump dump core immediately
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 ... gateway commands (see "help gateway")
help display this information
help <topic> display topic specific information, ? for list
hostname <name> specify name of this BalanceNG instance
inject <if> <pcap> <s> [<e>] inject packets from pcap file
interface ... interface commands (see "help interfaces")
ipallow <IP-address> insert IP address into list (module ipallow)
ipdeny <IP-Address> insert IP address into list (module ipdeny)
ipdb [<file.csv>] load IPDB from .csv file
license <serno> <key> specify serno and license key
locate <addr> lookup IP address in current IPDB
log <message> log a message to the BalanceNG log
macallow <mac-address> insert MAC address into list (module macallow)
macdeny <mac-address> insert MAC address into list (module macdeny)
macrouter <mac-address> declare MAC address as routing device
modules <ma>,<mb>,... define packet processing module chain
network <idx> <cmd> <value> modify network <idx>, see "help network"
no <command> revert command
purge <item> <number(s)> re-initialize servers/targets
register <item> <number(s)> register networks/servers/targets
reload reload server and target configuration
remark <remark> specify configuration remarks
resync schedule a complete session table resync
rms <id> remove session table entry (exact lookup)
rmsession <id> remove session table entry
rmt <target> remove all session table entries of specific target
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
sessionload <file> load all session information from file
set <parameter> <value> set parameter to specific value
show <item> show item, show ? for item list
shutdown alias for stop
snapshot <file> collect relevant service data in file (no full sessiontable)
snapshot-full <file> collect full snapshot with full sessiontable dump
snatrange <from> <to> specify SNAT IPv4 address range
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 <ipa> <ipb> <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"
bng#
help <subtopic> #
Synopsis: help <subtopic>
Displays help information about an available subtopic.
Example:
bng# help ?
available help topics:
? show this list of available help topics
cledit command line editing functionality
gateway default gateway commands
interface interface commands
network network commands
server virtual server commands
show information about items to show
target target (real server) commands
vrrp vrrp commands
bng# help gateway
gateway alert <script> specify gateway alert notification script
gateway arp <iv>,<to> perform arp healthcheck (ival,tout)
gateway arp off disable arp healthcheck
gateway ipaddr <ipaddr> specify default gateway ip address
gateway ipaddr6 <ipaddr6> specify default gateway IPv6 address
gateway nd6 <iv>,<to> perform nd6 healthcheck (ival,tout)
gateway nd6 off disable nd6 healthcheck
gateway ping <iv>,<to> perform ping healthcheck (ival,tout)
gateway ping off disable ping healthcheck
gateway ping6 <iv>,<to> perform ping6 healthcheck (ival,tout)
gateway ping6 off disable ping6 healthcheck
gateway trackval <val> specify tracking value for gateway (default=0)
gateway trackval default reset gateway tracking value to default (0)
gateway upalert <script> specify gateway upalert notification script
no gateway remove gateway declaration
bng#
inject #
Synopsis: inject <interface> <pcap-file> <from> [<to>]
This command injects one or more packets provided in a file in pcap format into the BalanceNG interface with the specified index or interval. If <to>
is omitted only one packet is injected (index <from>
).
This command is intended for debugging and QA purposes only and must not be used in a productive environment.
Example:
# bng ctl
BalanceNG: connected to PID 27055
test# inject 1 /tmp/icmp.pcap 2
no: 2 len: 70
00 00 5E 00 44 04 04 1C 7F 43 48 F0 08 00 45 00 00 38 C9 11 34 04 F7 01 2B 72 0A EE F0 88 0A EE C8 DC 03 04 34 F8 00 00 05 48 43 68 05 50 30 32 40 00 76 06 E4 65 0A EE C8 DC 0A 43 02 6E 43 BB F2 43 2C E4 A4 C1
vrrp ... continue
arp ... continue
ping ... continue
hc ... continue
master ... continue
slb ... done.
test#
locate #
Synopsis: locate <IP-address>
This command initiates a lookup in the in-memory IPDB database (IP to location databases) with the given IP address (IPv4 or IPv6) as the key. The location counters (as show by “show locations”) are not being incremented by this lookup.
The included .csv database file IP2LOCATION-LITE-DB1.IPV6.CSV is available from https://lite.ip2location.com.
Example:
# bng start 2
BalanceNG: starting up instance 2 ...
# bng control 2
BalanceNG: connected to instance 2 PID 1763
bng# ipdb
bng# sh ipdb
IPDB6 loaded from /opt/BalanceNG/IP2LOCATION-LITE-DB1.IPV6.CSV
527250 valid 4-column lines
527250 total IPDB6 entries available
no consecutive area overlaps
250 different IPDB locations referenced
bng# locate 1.1.1.1
address 1.1.1.1 is in US
bng# locate 2a01:198:200:76c::2
address 2a01:198:200:76c::2 is in DE
bng#
pcap-search #
Synopsis: pcap-search <pcap-file> <search-string>
This command searches for the specified string in every packet contained in the specified file in pcap format and prints out the numbers of packets containing that string.
Example:
bng# pcap-search /tmp/lan.pcap 4e01ddb1a498
639
640
641
642
798 packets processed
bng#
purge #
Synopsis:
purge interface <interface no.>
purge network <network no.>
purge server <server no.>
purge target <target no.>
This command resets the given interface, network, server or target data structures to an initial uninitialized state. The object must be in unregistered state, multiple interface, network, server or target numbers may be specified.
Example:
bng# unregister target 1
bng# purge target 1
rms #
Synopsis: rms <session-id>
This command removes a single session table entry by performing one single session table lookup. If there’s no session table entry found, this command has no side-effect.
rmsession #
Synopsis: rmsession <session-id substring>
This command removes all session table entries with a matching session-id substring (the same set as shown by show session <session-id substring>
). Please note that a complete linear traversal of the session table is performed every time this command is executed.
rmt #
Synopsis: rmt <target>
This command removes all session table entries which are associated to a specific target. Please note that a complete linear traversal of the session table is performed every time this command is executed.
resync #
Synopsis: resync
This command starts a session table resync on the current VRRP master. The parameter sessionsyncack needs to be set to 1 (enabled).
Example:
bng# resync
ok, 1000000 entries scheduled for resync
bng# sh log
2012/12/20 16:33:27 6 RESYNC OF 1000000 ENTRIES SCHEDULED
2012/12/20 16:41:31 6 RESYNC COMPLETE
bng#
save #
Synopsis: save
This saves the current configuration (as shown by show conf
) to the configuration file of
BalanceNG in /etc/bng.conf (or /etc/bngN.conf for other instances as the default instance 0).
Example:
bng# save
saved /etc/bng.conf
bng#
save conf #
Synopsis: save conf
This command saves the current configuration (as shown by show conf
) to the
configuration file just like save
.
save private #
Synopsis: save private
This command saves the node specific private data in the associated private data configuration file (/etc/bng.private or /etc/bngN.private). The following data is considered to be “node specific private”:
- The
hostname
setting - The VRRP priority
- All
network <n> real
andnetwork <n> real6
addresses
The private data may be displayed with show private
without any saving.
Example:
bng# save private
saved /etc/bng.private
bng#
save all #
Synopsis: save all
This command save both the configuration and the private configuration data of the current instance.
Example:
bng# save all
saved /etc/bng.conf
saved /etc/bng.private
bng#
sessiondump #
Synopsis: sessiondump <filename>
The command dumps the complete session table information into the specified file in ascii
readable text format (as displayed by the show sessions
command).
During the dumping process the internal packet forwarding mechanism is paused, which may cause a noticeable delay of packet processing.
Example:
bng@testnode# sessiondump /tmp/test.txt
dumping 17 sessions to /tmp/test.txt ...... done.
bng@testnode#
sessionload #
Synopsis: sessionload <filename>
This command allows to load the internal session-table from a file, that has been previously
exported by a sessiondump
command invocation.
show #
Synopsis: show <item>
The command show
displays various informationn.
show ? #
Synopsis: show ?
This informational command displays which items may be specified using the show command (replacing the ?).
Example:
bng# show ?
show arphash show arp hashtable
show benchmark show benchmark status and results
show bngsync show bngsync status
show break show current process break
show conf show current configuration
show debugscopes show available debugscopes
show gateway show gateway info and status
show ifstat show interface statistics
show instance show current instance number
show interfaces same as ifstat
show ipdb show IPDB (IP location database) info
show lgrp show location group information
show lgrp <A-Z> show specific location group status
show license show license information
show locations show available IPDB locations
show log show recent log messages
show machash show learned mac addresses
show maxbucket show session table max bucket list length
show modules show available and active modules
show module <module> show specific module information
show nat show network address translations
show networks show specified networks
show network <n> show network <n> information
show nodeid show licensing nodeid
show nous show number of unsync'ed sessions
show parameters show settable parameter data
show private show private configuration data
show server <n> show status of server <n>
show servers show server overview
show sessions show session table information
show snat show SNAT information
show startuplog show startup log messages
show stinfo show session hashtable information
show targets show target overview
show target <n> show status of target <n>
show threads show threads overview
show uptime show uptime in seconds
show vips show vips and their mac-addresses
show vnodeid show licensing vnodeid
show version display version information
show vrrp display VRRP status
bng#
show arphash #
Synopsis: show arphash
Displays the current ARP hash of BalanceNG. The output consists of several columns: The IP-address, the MAC address (00:00:00:00:00:00 if not yet resolved) and several flags.
Static entries are usually self generated and maintained entries (like BalanceNG virtual servers), dynamic entries are usually BalanceNG targets.
Example:
bng1# show arphash
ipaddr ethaddr tgt net cntr age flags
--------------- ----------------- ---- --- ----- ----- -----------
172.17.2.61 06:00:ac:11:02:3d - 1 - - vip fix
172.17.2.64 00:00:5e:00:01:0e - 1 - - vip
172.17.2.91 00:e0:81:5d:2a:65 1 - 203 192
bng1#
show benchmark #
Synopsis: show benchmark
Displays the current benchmark status and the results (when finished).
Example:
bng# show benchmark
benchmark active and running:
duration (seconds) : 300
packetsize : 1514
window size : 16
packets sent : 212921
packets received : 212905
seconds remaining : 294
bng# show benchmark
benchmark finished with the following results:
duration (seconds) : 300
packetsize : 1514
window size : 16
packets sent : 10797158
packets received : 10797142
lost packets : 0
packets per second : 35990
bytes per second : 54489577
show bngsync #
Synopsis: show bngsync
Displays the current status of the bngsync session table synchronization.
Example:
bng# show bngsync
bngsync is active
we are talking (and expecting) IPv6 UDP port 10439
the MAC address for syncpeer is known as 06:01:00:40:39:b2
bng#
show break #
Synopsis: show break
Displays the current process break (of the BalanceNG main thread) as returned by sbrk() in hexadecimal format. This allows to prove the absence of memory leaks over time.
Example:
bng# show break current break is 0xb17b000 bng#
show conf #
Synopsis: show conf
Displays the current active configuration of a BalanceNG instance as it would be saved to the configuration file using the save command.
show conf <section> #
Synopsis: show conf <section>
This command displays specific sections of the configuration file intended for automatic access by programs layered on top of BalanceNG (like Web-UI’s).
show conf hostname #
Synopsis: show conf hostname
This command displays the hostname
line as it appears in the output of “show conf”.
show conf network #
Synopsis:
show conf network <idx>
show conf network states
This command displays specific network sections the same way as they appear in the configuration.
show conf remark #
Synopsis: show conf remark
This command displays the remark
line as it appears in the output of show conf
.
show conf server #
Synopsis:
show conf server <idx>
show conf server states
This command displays specific server sections the same way as they appear in the configuration file.
show conf target #
Synopsis:
show conf target <idx>
show conf target states
This command displays specific target sections the same way as they appear in the configuration file.
show debugscopes #
Synopsis: show debugscopes
This command displays a list of the available settings for the debugscope parameter.
Example:
testA# show debugscopes
0 off
1 target script debugging
2 target ascript debugging
3 server plugin debugging
4 DNS library debugging
5 location group (LGRP) debugging
testB#
The debugscope parameter must not be enabled during productive use of BalanceNG.
show gateway #
Synopsis: show gateway
Displays informations about the gateway and its current state (see “gateway” setup commands).
Example:
bng# show gateway
ipaddr: 172.17.2.254
total status: operational
ping status: up
trackval: 4
bng#
show ifstat #
Synopsis: show ifstat
Displays informations about the Ethernet interfaces which are currently under control of BalanceNG.
show instance #
Synopsis: show instance
This shows the number of the current BalanceNG instance.
Example:
# bng start 41
BalanceNG: starting up instance 41 ...
# bng control 41
BalanceNG: connected to instance 41 PID 27231
bng# show instance
this is BalanceNG instance 41
bng#
show interfaces #
Synopsis: show interfaces
This is a synonym and equivalent to show ifstat
.
show ipdb #
Synopsis: show ipdb
This shows information about the current status of the internal IPDB in-memory database.
Example:
bng# show ipdb
IPDB6 loaded from /opt/BalanceNG/IP2LOCATION-LITE-DB1.IPV6.CSV
539915 valid 4-column lines
539915 total IPDB6 entries available
no consecutive area overlaps
250 different IPDB locations referenced
bng#
show license #
Synopsis: show license
This shows the current licensing status of BalanceNG on the current host machine (node). If the current configuration contains a valid license for the nodeid of the machine then the output could look like follows:
bng# show license
status: valid full license
serial: TEST0611021
nodeid: 2a:e2:9f:38:da:20
type "show version" for version and Copyright information
bng#
A trial license status looks like this:
bng# show license
status: trial license (instance will terminate in 10061 minutes)
trial license expiry date : 2023-11-01
trial expiry date of build: 2023-12-01
nodeid: 93:18:01:49:10:69
type "show version" for version and Copyright information
bng#
show lgrp #
Synopsis: show lgrp
This command displays all currently configured location groups and their logical state. An “ok” in column 2 means that all group interdependencies have been solved for that group whereas a question mark indicates that the group specification references yet unknown information.
Example:
bng# show lgrp
A ok "DE,AT,CH"
B ok "*,!A,!Z"
D ok "E"
E ok "F"
F ok "GB"
Y ok "D,F"
Z ok "!Y"
bng#
show lgrp <g> #
Synopsis: show lgrp <group>
This command displays more detailed information about the specified location group (referenced as a single capital letter A-Z) including all locations that are member of this group.
Example:
bng# show lgrp
A ok "DE,AT,CH"
B ok "*,!A,!Z"
D ok "E"
E ok "F"
F ok "GB"
Y ok "D,F"
Z ok "!Y"
bng# show lgrp A
grp A (solved)
txt DE,AT,CH
key description
--- ------------------------------------
AT AUSTRIA
CH SWITZERLAND
DE GERMANY
--- ------------------------------------
3 total entries
bng# show lgrp B
grp B (solved)
txt *,!A,!Z
key description
--- ------------------------------------
AD ANDORRA
AE UNITED ARAB EMIRATES
AF AFGHANISTAN
AG ANTIGUA AND BARBUDA
AI ANGUILLA
AL ALBANIA
...
ZM ZAMBIA
ZW ZIMBABWE
- *** NOT FOUND PSEUDO ENTRY ***
--- ------------------------------------
233 total entries
bng#
show locations #
Synopsis: show locations
This command displays the current referenced locations in the internal IPDB (if loaded).
Example:
BalanceNG: connected to PID 89251
bng# ipdb
bng# show locations
key counter description
--- -------- ------------------------------------
AD Andorra
AE United_Arab_Emirates
AF Afghanistan
AG Antigua_and_Barbuda
AI Anguilla
AL Albania
AM Armenia
AO Angola
AQ Antarctica
AR Argentina
...
YE Yemen
YT Mayotte
ZA South_Africa
ZM Zambia
ZW Zimbabwe
ZZ UNSPECIFIED or PRIVATE
- *** NOT FOUND PSEUDO ENTRY ***
--- -------- ------------------------------------
250 0 total
bng#
show log #
Synopsis: show log
Displays the most recent log messages as they have been sent to the syslog. Up to currently 40 log messages are stored in a cyclic buffer.
Errors found in the initial startup file are also reported to the syslog and may be displayed here for further analysis.
Example:
bng1# show log
2008/10/11 21:25:18 6 main interface is bge0
2008/10/11 21:25:18 6 BalanceNG 1.672: starting background operation
2008/10/11 21:25:18 6 loading /etc/bng.conf
2008/10/11 21:25:18 6 configuration taken Sun Oct 1 15:58:39 2008
2008/10/11 21:25:18 6 configuration saved by BalanceNG 1.643 (created 2008/10/01)
2008/10/11 21:25:18 5 this virtual router is now BACKUP
2008/10/11 21:25:18 6 /etc/bng.conf successfully loaded
2008/10/11 21:25:22 5 this virtual router is now MASTER
2008/10/11 21:25:24 5 target 1 operational
bng1#
show machash #
Synopsis: show machash
Displays the learned MAC addresses and their associated interfaces. For security reasons BalanceNG restricts the amount of different MAC addresses to 10000 (and will stop any further learning in that case).
If the MAC address belongs to a target the target number is show in the “tg” column of the output.
Example:
bng# show machash
ethaddr tg ifc
----------------- -- ----
00:04:13:25:06:97 bge0
00:0a:8a:f8:cb:01 bge0
00:14:4f:48:82:50 bge0
00:04:13:22:1b:03 bge0
00:14:bf:66:70:36 bge0
00:00:5e:00:01:09 bge0
00:0c:f1:9c:90:e8 bge0
00:14:38:95:7a:04 bge0
06:00:ac:11:02:54 bge0
00:0b:82:00:a8:fe bge0
00:20:e0:69:ad:4c bge0
00:11:50:c3:54:ce bge0
00:e0:81:5d:2a:65 bge0
00:02:2d:15:ac:53 bge0
00:04:13:25:06:96 bge0
00:40:63:c9:f5:b5 bge0
00:0e:0c:6c:ba:59 1 bge0
bng#
show maxbucket #
Synopsis: show maxbucket
This command displays the length of the largest bucket list of the internal session table management data structure. This length should be minimal and is an indicator for the quality of the session-id hash function. This command blocks all packet processing threads for some short time and should therefore not be executed during production or stress testing.
Example:
bng# sh maxbucket
length of longest session table bucket list: 2
bng#
show modules #
Synopsis: show modules
Displays the current active module chain and a list of available modules.
Example:
bng# show modules
current global module chain:
vrrp,arp,ping,hc,master,slb,tnat,nat,rt
specific information of module "master":
VRRP not active
supported module chains:
benchmark
vrrp,arp,ping,hc,master,[tarpit,]slb,tnat,nat,rt
vrrp,arp,ping,hc,master,llb
available modules (* indicates "in use"):
arp * - ARP request/reply processing
crossover - virtual crossover cable
ddosp - DDOS attack protection module
haswitch - advanced HA switch
hc * - health-check processing
imc - includes an available interface-specific module chain
ipallow - simple IP address allow filter
ipdeny - simple IP address denial filter
isolate - MA-L 34-38-AF isolator
lfilter - location based IPv4/IPv6 filter
llb - link load-balancing
macallow - simple MAC address allow filter
macdeny - simple MAC address denial filter
master * - proceed only if current master
nat * - NAT processing
out - packet output processing (EXPERIMENTAL)
ping * - ICMP echo request processing
rt * - IPv4 and IPv6 routing module
slb * - server load balancing
strict - strict IP packet acceptance filter (EXPERIMENTAL)
tarpit - tarpit module for IPv4 and IPv6
tnat * - target NAT module
vrrp * - initial VRRP handling
ip4debug - IPv4 debugging module (EXPERIMENTAL)
sctpdebug - SCTP debugging module (EXPERIMENTAL)
bng#
show module <module> #
Synopsis: show module <module>
This command shows module specific information for the specified module (if available).
show nat #
Synopsis: show nat
Displays the current active NAT table contents (Network Address Translation). The NAT table contains separate entries for TCP and UDP network address translations.
Examples:
bng# show nat
TCP: 0 entries
UDP: 0 entries
bng#
bng# show nat
TCP: 1 entry
ip-address iport oport age
--------------- ----- ----- ----
172.17.2.4 32853 20012 3
UDP: 2 entries
ip-address iport oport age
--------------- ----- ----- ----
172.17.2.4 32768 20573 3
172.17.2.4 123 20572 159
bng#
show network <n> #
Synopsis: show network <n>
Displays an overview of the current parameters of the specified network.
show networks #
Synopsis: show networks
Displays current parameters of all networks.
show nodeid #
Synopsis: show nodeid
Displays the nodeid of this BalanceNG installation.
Example:
bng# show nodeid
93:18:01:49:10:69
bng#
show nous #
Synopsis: show nous
Displays the number of unsynchronized sessions. If this command displays “0” on the current VRRP master and the parameter sessionsyncack is set to 1 (enabled), the session table of the VRRP backup is in sync with the session table of the VRRP master.
show parameters #
Synopsis: show parameters
This shows all the available parameters of BalanceNG. Please see the set command for detailed parameter explanations.
Example:
bng# show parameters
name min max default current
----------------- ---- ------- ------- -------
arplookup 5 60 10 10
arprefresh 60 3600 300 300
arptimeout 0 86400 0 0
backupalerts 0 1 1 1
bngsyncport 1024 49151 10439 10439
bmduration 10 86400 300 300
bmpsize 20 1514 1514 1514
bmwsize 1 10000 128 128
bngfilter 0 1 1 1
debugscope 0 9 0 0
dumprotation 1 1048576 1024 1024
eventinterval 10 600 10 10
gnatdlimit 10 100000 10 10
gratarpremind 0 120 0 0
hashbytes4 1 4 4 4
hashbytes6 1 16 16 16
hcportoffset 1024 65535 30000 30000
ipforwarding 0 1 0 0
localdsr 0 1 0 0
localvirt 0 1 0 0
maxsyncps 0 10000 0 0
multithreading 0 1 1 1
natdlimit 10 500 10 10
natscan 1 20 10 10
natsync 0 1 1 1
natsynciv 10 120 10 10
nattimeout 10 172800 600 600
noftupdate 0 1 0 0
outmtu 0 1514 0 0
psvrelearn 0 1 0 0
pthreadstacksize 0 1000000 204800 204800
sendprobes 0 1 0 0
sessionautoresync 0 1 1 1
sessionarrtimeout 0 3600 60 60
sessiongclimit 1000 500000 100000 100000
sessiondlimit 10 1000 10 10
sessionscan 1 20 10 10
sessionscanbup 1 1000 100 100
sessionsync 0 1 1 1
sessionsyncack 0 1 1 1
sessionsyncetype 0 1 0 0
sessionsynciv 10 120 10 10
sessiontimeout 10 172800 600 600
snattimeout 10 172800 1800 1800
sweeponreload 0 1 1 1
syncackbdelay 1 60 10 10
syncackmaxps 1 10000 2000 2000
syncackresend 1 60 5 5
syncackwsize 1 10000 100 100
stickytarget 0 1 1 1
strictrouting 0 1 1 1
tarpitrealto 60 86400 14400 14400
tarpittrapto 60 86400 600 600
tcphalfopen 0 1 1 1
vrrpmasterdown 3 10 3 3
vrrppreempt 0 1 0 0
vrrppreemptts 0 100 0 0
vrrpstateplugin 0 1 0 0
vrrpv3ip 4 6 5 5
vrrpversion 2 3 3 3
xstlog 0 1 0 0
haswitch:isolate 0 1 0 0
haswitch:timeout 10 86400 3600 3600
bng#
show private #
Synopsis: show private
This command shows the “private” node specific data of the current instance as it would be saved by “save private” to the private configuration file.
Example:
NodeA# show private
// private configuration data Sun Aug 24 22:56:40 2008
// BalanceNG 6.034 (created 2023/09/22)
hostname NodeA
vrrp priority 209
network 1 real 172.17.2.61
// end of private configuration data
NodeA#
show server <n> #
Synopsis: show server <n>
Shows information about a particular server and its current state.
Example:
bng# show server 1
server 1
ipaddr 10.55.55.222
network 1
port any
protocol any
status enabled
method rr
portrel on
targets 1,(5)
bng#
show servers #
Synopsis: show servers
This shows an overview of configured servers and their current state including the states of the associated targets.
A target or backup target as a number is operational according to it’s health checks, a target or backup target in round parentheses is not available due to health check failures, a target or backup target in square brackets is disabled by purpose.
Only enabled and previously registered server definitions are shown.
Example:
bng# show servers
# ipaddr port prt net S targets {backups}
------------------------------------------------------------
1 10.55.55.222 any any 1 e 1,2,3,4,(5),[6] {}
2 10.55.55.226 any any 1 e 8,9,(10),(11) {20}
bng#
In this example targets 1,2,3 and 4 of server 1 are operational. The health checks of target 5 are failing and target 6 is disabled.
Target 8 and 9 of server 2 are operational, 10 and 11 have currently failing health checks. There’s an operational backup target 20 available which would be addressed as soon as there’s no ordinary target available.
show sessiongroups #
Synopsis: show sessiongroups
Information about the current target sessiongroups is displayed (see target <n> sessiongroup and server <n> maxgrpsessions).
Example:
bng# show sessiongroups
grp sessions targets
--- --------- ----------------------------------------
0 0 2
7 0 1 3 4 5
show sessions #
Synopsis: show sessions [\<session-id substring\>]
Information about current active sessions in the BalanceNG session table is displayed.
The number of active sessions is displayed together with the first ten active sessions (which are usually the latest ones).
It is normal for the session tables to become very huge. The session table entry timeout is stored with each session table entry (column “stout”).
An optional second argument restricts the output to the specified session-id substring. The number of displayed session table entries is restricted by the sessiondlimit parameter.
Example:
bng# show sessions
4 sessions
srv tgt age timeout ftimeout SYNC session-id
--- --- ---- ------- -------- ---- ------------------
1 2 65 7320 0 SYNC 10.255.107.175:0
1 5 1 7320 0 SYNC 10.255.33.129:0
1 5 1148 7320 0 SYNC 10.255.129.138:0
1 4 776 7320 0 SYNC 10.255.130.136:0
bng#
Example 2:
bng@testnode# show sessions 10.255.107.175
4 sessions
srv tgt age timeout ftimeout SYNC session-id
--- --- ---- ------- -------- ---- ------------------
1 2 65 7320 0 SYNC 10.255.107.175:0
bng@testnode#
show snat #
Synopsis: show snat
Displays information current SNAT status.
show startuplog #
Synopsis: show startuplog
Displays the first log messages that appeared after the initial startup of the instance. The
output of show startuplog
is also included in the snapshot file (see snapshot
command).
show stinfo #
Synopsis: show stinfo
Displays information about the internal session hashtable. Session entries are pre-allocated in chunks, the number of current allocated chunks is also shown.
Example:
bng# sh stinfo
bytes/session: 256
allocated 0 chunks of 65536 entries
current number of TOTAL sessions ......... : 0
sessions created since startup ........... : 0
current number of NEW (unsynched) sessions : 0
current number of sessions waiting for ACK : 0
current number of ACK'ed sessions ........ : 0
bng#
show targets #
Synopsis: show targets
Displays information about current registered and enabled targets and their current health check status.
Example:
bng# show targets
no ipaddr ipaddr6 si port prt net net6 srv sessions status info name
-- -------------- ------------------------ -- ---- --- --- ---- --- -------- ----------- -------------------------- ----
1 10.100.206.85 2001:db8:5678:aaaa::85 3 any any 3 3 1 0 operational arp:up,nd6:up,agent:1
2 10.100.206.116 2001:db8:5678:aaaa::116 3 any any 3 3 1 1 operational arp:up,nd6:up,agent:1
3 10.100.206.117 2001:db8:5678:aaaa::117 3 any any 3 3 1 0 down arp:down,nd6:up,agent:down
4 10.100.206.118 2001:db8:5678:aaaa::118 3 any any 3 3 1 1 operational arp:up,nd6:up,agent:1
5 10.100.206.119 2001:db8:5678:aaaa::119 3 any any 3 3 1 2 operational arp:up,nd6:up,agent:1
14 10.100.206.123 2001:db8:5678:aaaa::123 3 any any 3 3 1 0 down arp:down,nd6:up,agent:down
16 10.100.206.124 2001:db8:5678:aaaa::124 3 any any 3 3 1 0 down arp:up,nd6:up,agent:down
bng#
show target <n> #
Synopsis: show target <n>
Displays more detailed information about a specific target.
Example:
bng# show target 1
target 1
status operational (arp:up,script:up)
ipaddr 172.17.2.91
port any
network 1
protocol any
sessions 0
maxsessions 0
sessiongroup 7
grpsessions 0
maxgrpsessions 5000
trackval 20
psent 0
bsent 0
prcvd 17
brcvd 4862
bwin 0
bwout 0
bw 0
bng#
show targetregistry #
Synopsis: show targetregistry
Displays more detailed information about current registered targets and their current health check status. This is a view from the internal target registry indented for debugging purposes. This command is needed only for testing purposes and not included in the overview output of the “help” command.
Example:
bng# show targetregistry
target 2
ipaddr 172.17.2.5
port any
network 1
protocol any
status down
arp up
agent down
target 1
ipaddr 172.17.2.4
port any
network 1
protocol any
status down
arp up
agent down
bng#
show threads #
Synopsis: show threads
Shows information about all active packet processing threads and the packet distribution among them.
Example:
bng# show threads
thread no 1
interface 1 (eth0)
packets processed 1332
thread no 2
interface 1 (eth0)
packets processed 1342
thread no 3
interface 1 (eth0)
packets processed 1303
show uptime #
Synopsis: show uptime
Displays the uptime of the currently running BalanceNG process in seconds.
Example:
bng# show uptime
current uptime is 10812 seconds
bng#
show vips #
Synopsis: show vips
Displays current configured virtual IP addresses, their associated Ethernet addresses and the associated network number.
Example:
bng# show vips
ipaddr ethaddr n
------------------------------ -------------------
10.1.1.100 34:38:af:17:5f:c2 2
10.55.55.222 00:00:5e:00:01:01 1
10.55.55.221 00:00:5e:00:01:01 1
bng#
show version #
Synopsis: show version
Display the current version and release of the running BalanceNG installation.
Example:
bng# show version
This is BalanceNG 6.030 RHEL9-x86_64 (2023/09/20)
Copyright (C) 2005-2022,2023 by Inlab Networks GmbH, Germany.
All rights reserved / Alle Rechte vorbehalten.
Visit load-balancer.inlab.net for further information.
bng#
show vnodeid #
Synopsis: show vnodeid
Displays the vnodeid of the current BalanceNG instance, which is a 6 byte identification being represented in MAC address format (not being a MAC address of course).
On macOS the vnodeid is now always identical to the HW MAC address of the en0 interface,
for Linux the vnodeid is derived from the /etc/machine-id
identification file.
Licensing BalanceNG with the vnodeid
is recommended for virtual machines.
Example:
bng# show vnodeid
21:06:5e:24:7a:f3 (interface eth0)
bng#
show vrrp #
Synopsis: show vrrp
Displays the current VRRP configuration and the current state of the VRRP node (as defined in rfc3768 with an additional “OFF”-State when deactivated).
Example 1 (node is master for 2 virtual addresses):
bng# show vrrp
state MASTER
vrid 1
priority 200
ip00 10.2.2.3
ip01 10.2.2.4
bng#
Example 2 (vrrp is not active):
bng# show vrrp
state OFF
Example 3 (node is backup for 2 virtual addresses):
bng# show vrrp
state BACKUP
vrid 1
priority 200
ip00 10.2.2.3
ip01 10.2.2.4
shutdown #
Synopsis: shutdown
This is an alias for stop
.
snapshot #
Synopsis: snapshot <file>
This command collects various important system data in text format into the supplied file. This file is intended to be sent to support staff for in detail analysis in case of problems.
Only a partial session table dump is generated according to the sessiondlimit parameter (see also snapshot-full
below).
Example:
bng# snapshot /tmp/snapshot.txt
collecting OS data ...... done.
dumping configuration ...... done.
collecting BNG data ...... done.
dumping sessiontable ...... done.
bng#
snapshot-full #
Synopsis: snapshot-full <file>
This command collects a snapshot with a full sessiontable dump.
snapshot-light #
Synopsis: snapshot-light <file>
This command is an alias for snapshot
.
stfill #
Synopsis: stfill <number-of-sessions>
This command fills the session table with the specified number of dummy session table entries. This is intended for testing and debugging purposes only.
Example:
bng# stfill 10000
bng# sh sessions
10000 sessions
srv tgt age timeout ftimeout SYNC session-id
----- ----- ----- ------- -------- ---- ------------------
1 1 12 600 0 TEST-DATA-0000009999
1 1 12 600 0 TEST-DATA-0000009998
1 1 12 600 0 TEST-DATA-0000009997
1 1 12 600 0 TEST-DATA-0000009996
1 1 12 600 0 TEST-DATA-0000009995
1 1 12 600 0 TEST-DATA-0000009994
1 1 12 600 0 TEST-DATA-0000009993
1 1 12 600 0 TEST-DATA-0000009992
1 1 12 600 0 TEST-DATA-0000009991
1 1 12 600 0 TEST-DATA-0000009990
1 1 12 600 0 TEST-DATA-0000009989
... remaining sessions not shown
bng#
stop #
Synopsis: stop
Immediately stops the BalanceNG program. This has the same effect as executing bng stop
on shell command line level. There’s no additional confirmation required.
Example:
bng# stop
ok
BalanceNG: no peer available
#