Skip to main content

CLI Overview

The abng command-line interface provides a JunOS-style interactive shell for managing AthenaBNG.

Features

  • Two Modes — Operational (view state) and Configuration (modify config)
  • Tab Completion — Context-aware command completion at every level
  • Pipe Filters — Filter output with | match, | count, | no-more, | save
  • Command History — Persisted to ~/.abng_history (up to 1000 entries)
  • Non-Interactive Mode — Execute single commands with -c flag
  • Context Help — Type ? to see available commands

Launching the CLI

Interactive Mode

/opt/athena-bng/bin/abng

Output:

AthenaBNG v0.1.0
Type '?' for help, 'quit' to exit.

abng>

Non-Interactive Mode

Execute a single command and exit:

/opt/athena-bng/bin/abng -c "show subscribers"
/opt/athena-bng/bin/abng -c "show system"

Custom Socket Path

Connect to a specific abngd socket:

/opt/athena-bng/bin/abng --socket /opt/athena-bng/run/abngd.sock

Command-Line Arguments

ArgumentShortDefaultDescription
--command <CMD>-cExecute single command and exit
--socket <PATH>-s/opt/athena-bng/run/abngd.sockPath to abngd socket
--versionPrint version and exit
--help-hPrint help and exit

Modes

Operational Mode (abng>)

View system state, monitor events, and execute operational requests.

Available commands:

  • show — Display operational state
  • configure — Enter configuration mode
  • monitor — Real-time event monitoring
  • request — Execute operational requests
  • ping — Ping from BNG (not yet implemented)
  • traceroute — Traceroute from BNG (not yet implemented)
  • quit — Exit CLI

Configuration Mode (abng#)

Modify the candidate configuration.

Available commands:

  • set — Add or modify configuration
  • delete — Remove configuration
  • show — Display candidate configuration
  • show | compare — Show diff vs running config
  • commit — Apply candidate to running config
  • commit confirmed <minutes> — Apply with auto-rollback
  • rollback <n> — Revert to archived config
  • discard — Discard candidate changes
  • exit — Return to operational mode
Key / CommandAction
? or helpShow available commands
TabAuto-complete current word
/ Browse command history
Ctrl+CCancel current input (does not exit)
Ctrl+DExit CLI
configureSwitch to configuration mode
exitReturn to operational mode or exit
quitExit from operational mode

Examples

View Subscribers

abng> show subscribers
┌────┬───────┬──────────┬───────────────┬────────────┬──────────┐
│ ID │ Type │ Username │ IP Address │ Interface │ Speed D/U│
├────┼───────┼──────────┼───────────────┼────────────┼──────────┤
1 │ PPPoE │ user1 │ 203.0.113.10 │ ppp0 │ 100M/40M │
2 │ DHCP │ - │ 203.0.113.20 │ eth1.111.5 │ 50M/20M │
└────┴───────┴──────────┴───────────────┴────────────┴──────────┘
Showing 2 active session(s)

Filter with Pipe

abng> show subscribers | match user1
1 │ PPPoE │ user1 │ 203.0.113.10 │ ppp0 │ 100M/40M │

abng> show subscribers | count
Count: 2

Configure PPPoE

abng> configure
abng# set pppoe enabled true
abng# set pppoe ac_name "AthenaBNG"
abng# set pppoe mtu 1492
abng# show | compare
abng# commit
abng# exit

Monitor Sessions

abng> monitor subscribers
[Live session monitor — press Ctrl+C to stop]

{"event": "session_up", "id": 1, "username": "user1", ...}
{"event": "session_up", "id": 2, "username": "user2", ...}

Command Structure

Commands follow a hierarchical structure:

show
├── subscribers [detail|pppoe|dhcp|summary]
├── interfaces
├── vlans
├── routes
├── bgp [summary]
├── ospf
├── qos
├── system
├── configuration [commands]
└── version

configure
├── set <path> <value>
├── delete <path>
├── show [| compare]
├── commit [confirmed <minutes>]
├── rollback <n>
└── discard

monitor
└── subscribers

request
├── subscriber disconnect [<id>|interface <name>]
├── radius test <username> <password>
└── system [...]

Pipe Filters

Available filters for show commands:

FilterSyntaxDescription
match| match <regex>Filter lines matching regex
count| countCount matching lines
no-more| no-moreDisable pager
save| save <file>Save output to file

Tab Completion

Tab completion works at every level:

abng> show <TAB>
subscribers interfaces vlans routes bgp ospf qos system configuration version

abng> show subscribers <TAB>
detail pppoe dhcp summary

abng# set <TAB>
system interfaces demux pppoe dhcp radius qos cgnat routing api snmp monitoring

abng# set pppoe <TAB>
enabled ac_name mtu mru lcp_echo_interval lcp_echo_failure

Context Help

Type ? after a partial command to see available options:

abng> show?
Possible completions:
subscribers Show active subscriber sessions
interfaces Show network interfaces
vlans Show dynamic VLAN interfaces
routes Show routing table
bgp Show BGP state
ospf Show OSPF state
qos Show QoS/CAKE status
system Show system information
configuration Show running configuration
version Show software version

Next Steps