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 descriptions 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. |
When you execute configurations through CTRLD, and then with the Command Line Interface, it results in error when you commit the configuration through the CLI. The reason is that CTRLD directly interacts with the backend applications (BDS and CONFD) and these changes are not synced with the user-facing CLI. |
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 <...>
Display Date and Time
To display system date and time, use the date
command.
date
Example:
supervisor@rtbrick>LEAF01: op> date Thu Apr 28 09:56:32 UTC 2022
Display Routes
The show route
command displays information of routes.
Syntax:
show route <options>
Attribute | Description |
---|---|
- |
Without any option, the command displays the information for all routes for all modules. |
detail |
Shows detailed route information. |
instance <name> |
Routing table information for a specified instance. |
ipv4 |
Shows route information for the IPv4 routing table. |
ipv6 |
Shows route information for the IPv6 routing table. |
mpls |
Shows route information for the MPLS routing table. |
label <value> |
Shows route information for a specified destination label. |
prefix <value> |
Shows route information for a specified destination prefix. |
prefix-length-distribution |
Shows the number of routes with the same prefix length for the sources. |
source |
Shows routes from a specified source. |
summary |
Shows the number of routes selected by RIBD for each source. |
Example 1: Route information
supervisor@rtbrick>LEAF01: op> show route
Instance: default, AFI: ipv4, SAFI: unicast
Prefix/Label Source Pref Next Hop Interface
11.0.0.1/32 arp-nd 6 11.0.0.1 hostif-0/0/4/1
12.1.0.0/24 ospf 10 23.0.0.2 hostif-0/0/0/1
23.0.0.0/24 direct 0 23.0.0.0 hostif-0/0/0/1
25.0.1.0/24 ospf 10 23.0.0.2 hostif-0/0/0/1
25.1.1.0/24 ospf 10 23.0.0.2 hostif-0/0/0/1
34.0.3.3/32 direct 0 34.0.3.3 hostif-0/0/2/1
56.0.1.4/30 ospf 10 23.0.0.2 hostif-0/0/0/1
56.0.2.0/31 ospf 10 34.0.2.4 hostif-0/0/1/1
Example 2: Route summary
supervisor@rtbrick>LEAF01: cfg> show route summary
Instance: default
Source Routes
bgp 2
direct 4
Total Routes 6
Instance: ip2vrf
Source Routes
bgp 6
direct 2
Total Routes 8
Instance: li-vrf
Source Routes
bgp 4
direct 2
Total Routes 6
Instance: mgmt-vrf
Source Routes
bgp 2
direct 2
Total Routes 4
Instance: radius-vrf
Source Routes
bgp 5
direct 2
Total Routes 7
Example 3: Routes with the same prefix length for IPv4
supervisor@rtbrick>LEAF01: cfg> show route prefix-length-distribution
Instance: default
Prefix Length Count
/32 2
/128 4
Sum 6
Instance: ip2vrf
Prefix Length Count
/0 2
/24 1
/32 2
/64 1
/128 2
Sum 8
Instance: li-vrf
Prefix Length Count
/0 2
/32 2
/128 2
Sum 6
Instance: mgmt-vrf
Prefix Length Count
/32 2
/128 2
Sum 4
Instance: radius-vrf
Prefix Length Count
/0 2
/24 1
/32 2
/128 2
Sum 7
Show Route Resolution
The show route-resolution
command displays the routes which were requested to be resolved for their nexthops. Otherwise, it shows the route is unresolved.
Syntax:
show route-resolution <options>
- | Without any option, the command displays the information for all requests and response tables side by side. |
---|---|
destination-instance |
Displays the information for all requests and response for a destination instance. |
look-up instance |
Displays lookup instance routes. |
prefix |
Displays routes for prefix 4 or prefix 6. |
resolved |
Displays resolved routes. |
source |
Displays source of requested source. |
unresolved |
Displays unresolved routes. |
Example:
supervisor@L1-STD-2-2008>bm08-tst.hel.rtbrick.net: op> show route-resolution 192:1::1, Source: bgp Destination instance: default, AFI: ipv4, SAFI: vpn-unicast Lookup instance: default, AFI: ipv6, SAFI: labeled-unicast Covering Prefix: 192:1::1/128 Interface MAC Address Nexthop hostif-0/0/1/10 7a:11:21:c0:00:03 fe80::7811:21ff:fec0:3 192:1::1, Source: bgp Destination instance: default, AFI: ipv4, SAFI: vpn-multicast Lookup instance: default, AFI: ipv6, SAFI: labeled-unicast Covering Prefix: 192:1::1/128 Interface MAC Address Nexthop hostif-0/0/1/10 7a:11:21:c0:00:03 fe80::7811:21ff:fec0:3 <...>
Example:
supervisor@rtbrick>ufi07.q2c.u21.r4.nbg.rtbrick.net: cfg> show route-resolution unresolved 192.168.16.128, Source: radius Lookup instance: inband_mgmt, AFI: ipv4, SAFI: unicast Covering Prefix: None, 7 resolution attempts 198.18.73.251, Source: pim Lookup instance: ip2, AFI: ipv4, SAFI: unicast Covering Prefix: None, 7 resolution attempts
Viewing Configuration
View Configuration
To view configurations, 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 configurations 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
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 configurations, 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 configurations 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 configurations, 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>
|