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
-cflag - 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
| Argument | Short | Default | Description |
|---|---|---|---|
--command <CMD> | -c | — | Execute single command and exit |
--socket <PATH> | -s | /opt/athena-bng/run/abngd.sock | Path to abngd socket |
--version | Print version and exit | ||
--help | -h | Print help and exit |
Modes
Operational Mode (abng>)
View system state, monitor events, and execute operational requests.
Available commands:
show— Display operational stateconfigure— Enter configuration modemonitor— Real-time event monitoringrequest— Execute operational requestsping— 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 configurationdelete— Remove configurationshow— Display candidate configurationshow | compare— Show diff vs running configcommit— Apply candidate to running configcommit confirmed <minutes>— Apply with auto-rollbackrollback <n>— Revert to archived configdiscard— Discard candidate changesexit— Return to operational mode
Navigation
| Key / Command | Action |
|---|---|
? or help | Show available commands |
Tab | Auto-complete current word |
↑ / ↓ | Browse command history |
Ctrl+C | Cancel current input (does not exit) |
Ctrl+D | Exit CLI |
configure | Switch to configuration mode |
exit | Return to operational mode or exit |
quit | Exit 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:
| Filter | Syntax | Description |
|---|---|---|
match | | match <regex> | Filter lines matching regex |
count | | count | Count matching lines |
no-more | | no-more | Disable 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
- Shell Behavior — Detailed shell features
- Operational Mode — All
showandrequestcommands - Configuration Mode — All
set,delete,commitcommands - Pipe Filters — Filter and format output