Configuration

LuCI Bandix stores all of its settings in the UCI configuration file /etc/config/bandix, which is read by the Bandix backend when it starts. This page describes how the file is organized, every option the Settings page writes, their defaults and effects, how to change them from the command line, and which settings are stored elsewhere (in the backend or in your browser).

Where Configuration Lives

What Where Edited by
Service settings (interface, port, modules, storage) /etc/config/bandix (UCI) Network → Bandix → Settings, or uci
Hostname bindings, schedule rules, global rate limit and whitelist, traffic quotas Backend state, kept in the backend's data directory Status page dialogs, or the RPC methods
GeoIP databases geoip_dir (default /usr/share/bandix-geoip) Settings page GeoIP manager
Display preferences (sort order, period, display mode) Browser localStorage Status page controls

The bandix UCI file itself is installed by the backend package. If one of the four named sections is missing, the Settings page adds it before rendering, so the form always appears.

File Layout

The configuration uses four named sections:

config general 'general'
    option host '127.0.0.1'
    option port '8686'
    option iface 'br-lan'
    option log_level 'info'
    option data_dir '/usr/share/bandix'
    option tc_backend 'auto'

config traffic 'traffic'
    option enabled '1'
    option speed_unit 'bytes'
    option traffic_enable_storage '1'
    option traffic_flush_interval '600'
    option traffic_neighbor_flush_enable '0'
    option traffic_realtime_window '600'
    option traffic_exclude_iface_device '0'

config connections 'connections'
    option enabled '0'
    option geoip_dir '/usr/share/bandix-geoip'

config dns 'dns'
    option enabled '0'
    option dns_max_records '10000'
    option dns_enable_storage '0'

This is an illustrative example of what the Settings page writes, not a copy of a shipped file.

Applying Changes

Save & Apply in LuCI commits the bandix configuration and triggers the backend's reload through its init script. From a shell, commit and restart explicitly:

uci set bandix.traffic.speed_unit='bits'
uci commit bandix
/etc/init.d/bandix restart

The Settings page also has a Restart Bandix Service button that runs /etc/init.d/bandix restart (see Updates and Maintenance).

Note: The views read some options (for example speed_unit and the enabled flags) when the page loads. After changing settings, reload the Status, Connections or DNS page to pick up the new values.

general Section

Basic settings for the backend service.

Option Type Default Description
host IP address (no mask) 127.0.0.1 Address the backend's HTTP API listens on
port port number 8686 Port the backend's HTTP API listens on
iface network device (none, required) LAN device to monitor, for example br-lan
log_level trace, debug, info, warn, error info Backend log verbosity
data_dir path /usr/share/bandix Where the backend stores persisted data
tc_backend auto, tcx, netlink auto How eBPF programs are attached to the interface
tc_order first, default, last, before, after default Position among other TCX programs (only with tcx)
netlink_priority integer 0–65535 0 TC filter priority (only with netlink; 0 means default)
tcx_anchor_ingress_id unsigned integer (empty) Ingress program ID to anchor to (only with tcx and before/after)
tcx_anchor_egress_id unsigned integer (empty) Egress program ID to anchor to (only with tcx and before/after)

host and port

These control where the backend listens, and also where the RPC plugin connects. The plugin /usr/libexec/rpcd/luci.bandix reads both values every time it runs and builds its base URL as follows:

host value URL used by the RPC plugin
empty or unset http://127.0.0.1:<port>
0.0.0.0 http://127.0.0.1:<port>
:: http://[::1]:<port>
any other IPv6 address (contains :) http://[<host>]:<port>
any other IPv4 address http://<host>:<port>

An empty port falls back to 8686. Keep the default 127.0.0.1 unless another tool on your network needs direct access to the backend API: with 0.0.0.0 or :: the API, which has no authentication of its own, becomes reachable from every interface the firewall allows.

iface

The device whose traffic is counted. Select the bridge or interface your LAN clients are attached to (normally br-lan). The picker allows bridges but hides aliases. Traffic of clients on other interfaces is not seen unless their subnets are routed through this one (see traffic_additional_subnets).

data_dir

Directory for persisted traffic history and other backend data. The default /usr/share/bandix lives on the router's overlay flash. If you change it, the Settings page reminds you to add the new directory to the backup list (System → Backup / Flash Firmware → Configuration) so the data survives a sysupgrade.

The Clear Traffic Data button deletes everything inside <data_dir>/metrics.

Bandix attaches eBPF programs to the ingress and egress hooks of iface. Three attach methods are available:

Value Meaning When to use
auto Let the backend decide Recommended default
tcx Use the TCX attach API Preferred on kernel 6.6 and newer
netlink Classic TC filter via netlink Safer on older kernels

Additional options appear in the form depending on the backend:

  • tc_order (only for tcx) positions Bandix's programs relative to other TCX programs on the same interface. before and after need an anchor.
  • tcx_anchor_ingress_id and tcx_anchor_egress_id (only for tcx with tc_order set to before or after) are the BPF program IDs to anchor to. They must be valid programs of the matching direction on the same interface.
  • netlink_priority (only for netlink) is the TC filter priority, from 0 to 65535, where 0 means the default.

These settings matter when other eBPF or TC-based tools (for example traffic shapers) run on the same interface.

traffic Section

Option Type Default Description
enabled flag 0 Enable the traffic monitor
speed_unit bytes, bits bytes Display unit for rates in all views
traffic_enable_storage flag 0 Persist long-term history to disk
traffic_flush_interval seconds 600 How often persisted data is flushed (only with storage enabled)
traffic_neighbor_flush_enable flag 0 Periodically flush the neighbor table data
traffic_neighbor_flush_interval seconds 600 Neighbor flush interval (only when enabled)
traffic_realtime_window seconds 600 Length of the in-memory realtime history
traffic_export_url URL (empty) Push traffic data to this HTTP endpoint
traffic_event_url URL (empty) Push device online/offline events to this endpoint
traffic_additional_subnets comma-separated CIDRs (empty) Extra subnets treated as local
traffic_exclude_iface_device flag 0 Exclude the router itself from statistics

speed_unit

bytes shows rates in binary units (B/s, KiB/s, MiB/s, GiB/s, TiB/s, powers of 1024). bits shows decimal bit rates (bps, kbps, Mbps, Gbps, Tbps, powers of 1000). The setting also changes the units offered when entering rate limits: KiB/s, MiB/s and GiB/s in byte mode, or kbps, Mbps and Gbps in bit mode. Limits are always stored in bytes per second; 1 kbps is stored as 125 bytes/s.

Traffic volumes (totals, quotas) always use binary byte units regardless of this option.

traffic_enable_storage and traffic_flush_interval

Without storage, long-term statistics exist only in the backend's memory and are lost when the service restarts. With storage enabled, the backend flushes data to data_dir at the chosen interval. Available intervals: 1, 5, 10, 15 and 30 minutes, and 1, 2, 12 and 24 hours.

A short interval loses less data on a power cut; a long interval writes less to flash. On routers with small or worn flash, prefer 1 hour or more, or point data_dir at a USB drive.

traffic_realtime_window

How much realtime (1-second) history the backend keeps in memory for the Realtime Traffic Trends chart: 10, 15 or 30 minutes, or 1 hour. It never uses disk space; the badge above the chart shows the active window (for example "Last 10 Minutes").

traffic_neighbor_flush_enable and traffic_neighbor_flush_interval

When enabled, the backend periodically flushes its neighbor-table data. The setting's own help text says this is generally not recommended if the device list already works normally; use it only if stale or wrong IP-to-MAC associations persist. Intervals: 10, 15 and 30 minutes, and 1, 2, 12 and 24 hours.

traffic_export_url

When set, the backend pushes traffic data to this URL as an HTTP POST with a JSON body. Leave it empty to disable pushing. The payload format is defined by the backend.

traffic_event_url

When set, the backend sends a JSON POST to this URL whenever a device changes state between online and offline. Leave empty to disable.

traffic_additional_subnets

By default only the subnet of iface is considered local. List additional local subnets here as comma-separated CIDR blocks, for example:

uci set bandix.traffic.traffic_additional_subnets='192.168.2.0/24,10.0.0.0/8'
uci commit bandix

Use this when other local networks are routed through the monitored interface, so their traffic is classified as LAN rather than WAN.

traffic_exclude_iface_device

When enabled, the router's own address on the monitored interface is excluded from traffic statistics, so the device list shows only clients.

offline_timeout (Hidden)

The Status page decides whether a device is online by comparing its last-seen timestamp with bandix.traffic.offline_timeout (seconds, default 600). The option is no longer shown on the Settings page, but it is still read by the Status page, so it can be set from the shell:

uci set bandix.traffic.offline_timeout='300'
uci commit bandix

Reload the Status page afterwards. This affects only how the LuCI pages classify devices.

connections Section

Option Type Default Description
enabled flag 0 Enable the connection monitor
geoip_dir directory /usr/share/bandix-geoip Where GeoIP databases are stored

The Connections page and the getConnection/getConnectionFlows RPC methods check bandix.connections.enabled and return "Connection monitoring is not enabled" unless it is 1.

The GeoIP manager in this section downloads or imports IP location databases into geoip_dir. Country/city databases with ASN data can take tens of megabytes; point the directory at persistent storage or an external drive if flash is small, and save and apply the directory change before downloading. See IP Location Database.

dns Section

Option Type Default Description
enabled flag 0 Enable the DNS monitor
dns_max_records unsigned integer 10000 Maximum number of DNS records kept; oldest records are deleted beyond this
dns_enable_storage flag 0 Persist DNS records to disk
dns_flush_interval seconds 900 How often DNS data is flushed (only with storage enabled)

The getDnsQueries and getDnsStats RPC methods return "DNS monitoring is not enabled" unless bandix.dns.enabled is 1. dns_flush_interval offers the same choices as traffic_flush_interval.

Complete Example

A configuration for a home router with persistent history, bit-rate display, connection and DNS monitoring, and a push endpoint for online/offline events:

uci set bandix.general.iface='br-lan'
uci set bandix.general.log_level='info'
uci set bandix.traffic.enabled='1'
uci set bandix.traffic.speed_unit='bits'
uci set bandix.traffic.traffic_enable_storage='1'
uci set bandix.traffic.traffic_flush_interval='3600'
uci set bandix.traffic.traffic_realtime_window='1800'
uci set bandix.traffic.traffic_event_url='http://192.168.1.10:8123/bandix-events'
uci set bandix.connections.enabled='1'
uci set bandix.dns.enabled='1'
uci set bandix.dns.dns_max_records='20000'
uci commit bandix
/etc/init.d/bandix restart

The event URL is a placeholder for your own receiver.

Browser-Side Preferences

The Status page remembers some choices in the browser's localStorage. They are per browser, not per router:

Key Values Meaning
bandix_device_period all, today, week, month, year Period used for device totals in the list
bandix_device_mode simple, detailed Device list display mode
bandix_sort_by online, lan_speed, lan_traffic, wan_speed, wan_traffic Sort column
bandix_sort_order true, false true = ascending, false = descending

Clearing site data in the browser resets them.

Best Practices

  • Keep host at 127.0.0.1; the RPC plugin reaches the backend over loopback anyway.
  • Enable persistence only when you need long-term history, and choose a flush interval that suits your flash.
  • Add a custom data_dir and geoip_dir to the sysupgrade backup list.
  • Change tc_backend only if auto fails or you need to coexist with other TC programs.
  • Reload LuCI pages after changing settings.

See Also