RBFS Command Line Interface
RBFS CLI Overview
RBFS command line interface is a primary user interface that enables you to interact with RBFS for monitoring, configuring, debugging, and maintaining the system. RBFS command line interface, that runs on top of the Ubuntu shell, provides a rich set of commands which allow you to execute various operations on the system.
RBFS CLI commands are organized in hierarchies based on their functionalities. Commands, which are used to execute the same type of functions, have the same hierarchy. For example, to display information, you can use commands that start with 'show'. Delete
command, in RBFS, is used to remove an existing configuration.
The RBFS command-line interface has three modes: Configuration mode, Operation mode, and Debug mode.
Operational mode: This is the default mode of RBFS command line interface. Operational mode allows you to execute the operational commands such as show commands to view or monitor various system configuration and its current state.
Configuration mode: Configuration mode allows to execute various configurations for services or features. It also allows you to view the information for the existing configurations.
Debug mode: It allows you to execute troubleshooting or debugging operations in the RBFS system.
Using the CLI
The following are some of the utilities which help you working with the CLI faster and easier.
Complete Partially Typed Commands:
You can press Tab
key to complete a partially typed command. It helps you working with commands faster.
Command Options and Description:
If you do not know the options available for a command and the purposes of the options, you can enter the question mark symbol (?). It displays all the available command options and description for that commands.
In any of the modes, if you type the question mark symbol (?), the CLI displays a set of commands which can be executed in that particular mode. |
Launch the RBFS CLI
The following example shows how to start the RBFS CLI.
supervisor@rtbrick>LEAF01:~$ cli
supervisor@rtbrick>LEAF01: op>
'op>' shows you are in operational mode. |
CLI Prompt
The RBFS CLI prompt reflects the static hostname and host OS hostname. In RBFS, the static hostname is the container name and the dynamic hostname is derived from DHCP.
The format of the RBFS CLI prompt is as follows:
<username> @ <static_hostname> > <hostname.host-os>: <mode>
Example:
supervisor@rtbrick>LEAF01: op>
Switch CLI Modes
RBFS CLI has three modes: Configuration mode, Operation mode, and Debug mode.
You can enter switch-mode
command to change the CLI mode.
For example, enter switch-mode config
to switch to configuration mode.
The following example shows how to switch between modes.
supervisor@rtbrick>LEAF01: op> switch-mode
config Enter a given mode
debug Enter a given mode
operation Enter a given mode
The following example shows how to switch from the operation
mode to the config
mode.
supervisor@rtbrick>LEAF01: op> switch-mode config
supervisor@rtbrick>LEAF01: cfg>
Turn on/off Paging
To turn the paging on or off, use the following command:
paging [on | off]
-
off - Pagination will be turned off for the commands that span more than screen length
-
on - Pagination will be turned on for the commands that span more than screen length
Example:
supervisor@rtbrick>LEAF01: cfg> paging on
Display Command History
The history
command enables you to view the previously executed commands. You can execute the command in any of the CLI modes.
history
Example:
supervisor@rtbrick>LEAF01: op> history
show config set
exit
show config set
load config test.json
load config obj.json
show config set
exit
show config set
load config test.json
switch-mode config
load config test.json
load config obj.json
exit
switch-mode config
show config set
load config test.josn
load config obj
load config obj.json
exit
show config set
load config obj.json
load config test.json
exit
show bd running-status
load config test.json
show config set
exit
show bd running-status
show co
show cores
exi
show datastore confd table test index index2
exit
CLI Access Logs
RBFS supports sending command history log messages to Graylog, a log management software that enables real-time analysis of log messages.
The command history logs help you to understand which user has executed a specific command across multiple CLI sessions.
The log format for CLI command history logs is: User '%s' executed command '%s'.
System logging is implemented for RESTCONF.
For RESTCONF error logs, do not set the log level to 'info'. If you set the log level to info , logs are generated for all the restconfd requests.
|
Operational Commands
Display Core Files
You can use the show cores
command to show a set of system core files created when the device service has been crashed. This command is used for diagnostic purposes.
Example:
supervisor@rtbrick>LEAF01: op> show cores
Date Time Filename
May 10 09:02 core.lldpd.20220510-090237.1317.zst
May 10 09:02 core.igmp.iod.1.20220510-090228.1282.zst
May 10 09:02 core.pim.iod.1.20220510-090228.1280.zst
May 10 09:01 core.lldpd.20220510-090145.984.zst
May 10 09:01 core.igmp.iod.1.20220510-090140.991.zst
May 10 09:01 core.pim.iod.1.20220510-090140.989.zst
View Hardware Resource Usage Limit Information
In RBFS, you can view the hardware resource usage limit details.
Run the following command:
show hardware limits
Example:
supervisor@rtbrick>rtbrick.net: op> show hardware limits
Hardware resources:
Module: fib
ASIC : q2c
Role : accessleaf
Model : agcva48s
IPv4 route count : 1200000
IPv6 route count : 250000
Module: fib
ASIC : q2c
Role : accessleaf
Model : as7946-74xkb
IPv4 route count : 1200000
IPv6 route count : 250000
Module: fib
ASIC : q2c
Role : accessleaf
Model : as7946-30xb
IPv4 route count : 1200000
IPv6 route count : 250000
Module: fib
ASIC : q2c
Role : accessleaf
Model : s9600-72xc
IPv4 route count : 1200000
IPv6 route count : 250000
Module: bgp
ASIC : q2c
6PE label : 2
Module: confd
ASIC : q2c
Max MTU profile : 8
Max L3 MTU profile : 3
Max subscriber MTU profile : 6
Max physical MTU profile : 8
Module: rd
ASIC : q2c
Reboot Containers and Hosts
The reboot
command allows you to restart containers and hosts.
reboot <option>
Option | Description |
---|---|
- |
Without any option, this command allows you to reboot a container (default). You are prompted to confirm rebooting the container when you enter this command. You must answer yes or no. |
container |
This command allows you to reboot a container. You are prompted to confirm rebooting the container when you enter this command. You must answer yes or no. |
container-and-confirm |
This command reboots the container without prompting yes/no. |
device |
This command allows you to reboot a device. You are prompted to confirm rebooting the device when you enter this command. You must answer yes or no. |
device-and-confirm |
This command reboots the device without prompting yes/no. |
Example:
supervisor@rtbrick>LEAF01: cfg> reboot container
Display System Version Details
To display the version details of RBFS and its various components, use the show version
command.
show version
Example:
supervisor@ixr_pe1>srv3.nbg1.rtbrick.net: op> show version
UUID : 2abb4250-2a14-4e5c-84e2-6785eee158f8
Version : 22.6.0-g4internal.20220620060710+Bfs0000bgpauthlatest.C3abc099d
Role : spine
Platform : virtual
Format : lxd
Build date : 2022-06-20 06:07:10 UTC
Component Version Timestamp Branch
alertmanager 0.20.1001-internal.20220613124702+Bdevelopment.... 2022-06-07 20:01:29 development
cligen 0.1.0-internal.20220613140225+Bdevelopment.C9457c97b 2022-06-07 20:00:33 development
clixon 4.3.1-internal.20220618124913+Bdevelopment.C85593b60 2022-06-13 11:48:32 development
<...>
Viewing Configuration
View Configuration
To view configuration, enter the show config
command.
Example:
supervisor@rtbrick>LEAF01: cfg> show config
Display Configurations in a Specific Format
The show config
command displays the current committed configurations of the system. By default, this command displays the configurations in a json
format.
show config <format>
You can also specify the format explicitly, if needed. The available display formats are:
-
json: Display configurations in JSON format
-
set: Display configurations in CLI format (similar to commands executed)
-
netconf: Display configurations in XML format
-
text: Display configurations in textual format (similar to YANG definition)
The following example shows how configurations are displayed in the text format.
supervisor@rtbrick>LEAF01: op> show config text
daemon-options {
instance-name *;
afi *;
safi *;
bd-type bgp.appd;
bd-name bgp.appd.1;
}
daemon-options {
instance-name *;
afi *;
safi *;
bd-type bgp.iod;
bd-name bgp.iod.1;
}
interface {
name lo-0/0/0;
unit {
unit-id 0;
address {
ipv4 {
prefix4 198.51.100.75/24;
}
ipv6 {
prefix6 2001:db8:0:110::/32;
}
}
}
}
<...>
To view configuration in the set format, use the show config set
command.
Example:
supervisor@rtbrick>LEAF01: cfg> show config set
set interface ifp-0/0/1
set interface ifp-0/0/1 ifp-id 1
set interface ifp-0/0/2
set interface ifp-0/0/2 ifp-id 2
set instance blue
set instance blue protocol bgp address-family ipv4 multicast
set instance blue protocol bgp address-family ipv6 unicast
set instance red
set instance red protocol bgp address-family ipv4 unicast
set instance red protocol bgp address-family ipv6 unicast
View Configuration in a Specified Hierarchy
To view configuration in a specified hierarchy, use the following command:
supervisor@rtbrick>LEAF01: cfg> show config set instance red protocol bgp
set instance red protocol bgp address-family ipv4 unicast
set instance red protocol bgp address-family ipv6 unicast
Modifying Configurations
Commit CLI Configurations
To commit the configurations, use the commit
command.
The following example shows how to commit your changes.
supervisor@rtbrick>LEAF01:~$ cli
supervisor@rtbrick>LEAF01: op> switch-mode config
supervisor@rtbrick>LEAF01: cfg> <cli command goes here>
supervisor@rtbrick>LEAF01: cfg> commit
When you exit CLI configuration with uncommitted changes, a reminder text appears saying that you have changes to commit, as shown in the following example:
supervisor@rtbrick>LEAF01: cfg> exit
Uncommitted changes are present
1. Discard the changes and exit
2. Commit the changes and exit
3. Keep the changes and exit [Default behavior]
Enter one of the above choice to proceed :
Add a Configuration Description
An in-line description or comment can be added to a system configuration to describe it.
set system config-description <description>
Example:
supervisor@rtbrick>LEAF01: cfg> set system config-description "This is sample test configuration"
supervisor@rtbrick>LEAF01: cfg> commit
supervisor@rtbrick>LEAF01: cfg> show config
{
"ietf-restconf:data": {
"rtbrick-config:system": {
"config-description": "This is sample test configuration"
}
}
View Uncommitted Changes
To view the uncommitted changes, use the show diff
command:
supervisor@rtbrick>LEAF01: cfg> show diff
supervisor@rtbrick>LEAF01: cfg> set interface ifp-0/0/3 ifp-id 3
supervisor@rtbrick>LEAF01: cfg> set interface ifp-0/0/4 ifp-id 4
supervisor@rtbrick>LEAF01: cfg> show diff set
+set interface ifp-0/0/3
+set interface ifp-0/0/3 ifp-id 3
+set interface ifp-0/0/4
+set interface ifp-0/0/4 ifp-id 4
supervisor@rtbrick>LEAF01: cfg> show diff
}
+interface {
+ name ifp-0/0/3;
+ ifp-id 3;
+}
+interface {
+ name ifp-0/0/4;
+ ifp-id 4;
+}
instance {
Save Configuration
To save configuration, enter the following command:
supervisor@rtbrick>LEAF01: cfg> save config my_config.json
|
Delete the Entire Running Configuration at a Time
To delete the entire running-configuration at a time, use the discard all
command.
Example:
supervisor@rtbrick>LEAF01: cfg> discard all
View the Configuration Differences in the Current and Previous Versions
In RBFS, you can view the configuration differences between the current and the previous versions.
show diff <number>
supervisor@rtbrick>LEAF01: cfg> show diff 2
system {
- secure-management-status false;
+ secure-management-status true;
}
Rollback to a Previously Committed Configuration
To rollback to a specific configuration prior to the most recently committed one, use the following command:
rollback <number>
number
: Specifies the rollback ID. Range: 1 through 49. 0 refers to the active configuration, 1 refers to the most recent previous configuration. Default: 1
For example, to rollback to rollback ID 2, use the following command:
supervisor@rtbrick>LEAF01: cfg> rollback 2
Rollback to a Specific Version of Software Configuration
To rollback to a specific version of the software configuration, use the following command:
rollback commit-id <commit-hash>
Example:
supervisor@rtbrick>LEAF01: cfg> rollback commit-id 29d5db038c1920fdsdsdsdsdsd323232
Load Configuration
To load configuration, enter the following command:
load config <filename> <option>
The options include merge
and replace
. You can specify merge
after the file name to merge the configuration with the running configuration. Specify replace
to replace the running configuration with the new one. Without any option, it replaces the running configuration, by default.
supervisor@rtbrick>LEAF01: cfg> load config <filename>
|