Shell Behavior
Detailed documentation of CLI shell features and behavior.
Modes
The CLI operates in two modes, mirroring JunOS/VyOS conventions:
Operational Mode (abng>)
Purpose: View system state, monitor events, execute operational requests
Prompt: abng>
Available commands:
show— Display operational stateconfigure— Enter configuration modemonitor— Real-time event monitoringrequest— Execute operational requestsping— Ping from BNGtraceroute— Traceroute from BNGquit— Exit CLI?orhelp— Show help
Example:
abng> show subscribers
abng> monitor subscribers
abng> request subscriber disconnect 1
abng> quit
Configuration Mode (abng#)
Purpose: Modify the candidate configuration
Prompt: abng#
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?orhelp— Show help
Example:
abng# set pppoe enabled true
abng# set pppoe ac_name "AthenaBNG"
abng# show | compare
abng# commit
abng# exit
Navigation Keys
| Key | Action |
|---|---|
Tab | Auto-complete current word |
Shift+Tab | Reverse auto-complete |
↑ | Previous command in history |
↓ | Next command in history |
Ctrl+A | Move to start of line |
Ctrl+E | Move to end of line |
Ctrl+K | Delete from cursor to end of line |
Ctrl+U | Delete from start of line to cursor |
Ctrl+C | Cancel current input (does not exit) |
Ctrl+D | Exit CLI |
Backspace | Delete character before cursor |
Delete | Delete character at cursor |
Command History
History is persisted to ~/.abng_history with the following behavior:
- Max entries: 1000
- Ignore space: Commands starting with a space are not saved
- Persistence: History is saved when exiting the CLI
- Loading: History is loaded when starting the CLI
Example:
# This command is saved
abng> show subscribers
# This command is NOT saved (starts with space)
abng> show subscribers
# View history file
cat ~/.abng_history
Tab Completion
Tab completion is context-aware and works at every level:
Operational Mode Completion
abng> show <TAB>
subscribers interfaces vlans routes bgp ospf qos system configuration version
abng> show subscribers <TAB>
detail pppoe dhcp summary
abng> show subscribers detail <TAB>
<session_id>
abng> request <TAB>
subscriber radius system
abng> request subscriber <TAB>
disconnect
abng> request subscriber disconnect <TAB>
<session_id> interface
Configuration Mode Completion
abng# set <TAB>
system interfaces demux pppoe dhcp radius qos cgnat routing api snmp monitoring
abng# set system <TAB>
hostname router_id timezone log_level log_format ntp_servers dns_servers
abng# set pppoe <TAB>
enabled ac_name mtu mru lcp_echo_interval lcp_echo_failure
abng# delete <TAB>
system interfaces demux pppoe dhcp radius qos cgnat routing api snmp monitoring
Context Help
Type ? or help to see available commands:
abng> ?
Available commands:
show Show operational state
configure Enter configuration mode
monitor Real-time monitoring
request Execute operational requests
ping Ping from BNG
traceroute Traceroute from BNG
quit Exit CLI
Type a partial command followed by ? 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
abng> show subscribers?
Possible completions:
detail Show detailed subscriber info
pppoe Show PPPoE sessions only
dhcp Show DHCP sessions only
summary Show session count summary
Pipe Filters
Pipe filters allow you to filter and format output:
abng> show subscribers | match user1
abng> show subscribers | count
abng> show subscribers | no-more
abng> show subscribers | save /tmp/subscribers.txt
Available filters:
match <regex>— Filter lines matching regexcount— Count matching linesno-more— Disable pager (show all output without pausing)save <file>— Save output to file
Pager Behavior
Long output is automatically paged using less:
abng> show configuration
(output is paged)
-- More -- (press space to continue, q to quit)
To disable paging:
abng> show configuration | no-more
Error Handling
Connection Errors
If abngd is not running:
Error: cannot connect to abngd — is abngd running?
Solution:
sudo systemctl start abngd
Command Syntax Errors
Error: unknown command: 'show foo'. Type '?' for help.
Solution: Use tab completion or ? to see available commands.
Configuration Validation Errors
Validation error: invalid IP address: "not-an-ip"
Solution: Check the configuration syntax and try again.
Non-Interactive Mode
Execute a single command without entering the interactive shell:
/opt/athena-bng/bin/abng -c "show subscribers"
/opt/athena-bng/bin/abng -c "show system"
/opt/athena-bng/bin/abng -c "show configuration | no-more"
Use cases:
- Scripting and automation
- Integration with monitoring systems
- One-off queries
Exiting the CLI
From Operational Mode
abng> quit
Or press Ctrl+D.
From Configuration Mode
abng# exit
abng>
Then:
abng> quit
Or press Ctrl+D twice.
Tips and Tricks
Save Output to File
abng> show subscribers | save /tmp/subscribers.txt
Filter Output
abng> show subscribers | match "pppoe"
abng> show configuration | match "radius"
Count Results
abng> show subscribers | count
Count: 42
Disable Pager
abng> show configuration | no-more
View Command History
cat ~/.abng_history
Clear Command History
rm ~/.abng_history
Next Steps
- Operational Mode — All
showandrequestcommands - Configuration Mode — All
set,delete,commitcommands - Pipe Filters — Filter and format output