Knowledge Base

 
Reset Search
 

 

Article

NCOS: CLI - Common Use Examples

« Go Back

Information

 
Content

Series 3 FW v6.0 and newer: CLI - Common Usage Examples

Products Supported: AER31x0, AER2100, MBR1400, MBR1200B, CBA850, CBA750B, IBR300, IBR6x0, IBR11x0. Click here to identify your router.

NCOS Version: 6.0 - for information on upgrading NCOS Versions, click here.


Quick Links

Overview

Common Use Examples

Related Articles


Overview

This document contains practical examples including the relevant commands necessary to execute them on your own.


Common Use Examples

Finding something in the CLI

Searching for values in the configstore using only the "cd" and "ls" command can be frustrating and often overly time consuming. Thankfully, we have the "grep" command.
The "grep" command is a command line utility that looks for expressions that match your grep parameters.

[admin@DeskRouter: /]$ find / | grep zsis
/status/zsis
/status/zsis/status
/config/webfilter/zsis
/config/webfilter/zsis/dyndns
/config/webfilter/zsis/dyndns/password
/config/webfilter/zsis/dyndns/user_name
/config/webfilter/zsis/dyndns/dnsservers
/config/webfilter/zsis/dyndns/dnsservers/0
/config/webfilter/zsis/dyndns/dnsservers/0/priority
/config/webfilter/zsis/dyndns/dnsservers/0/ip_address

Checking Router Uptime

[admin@DeskRouter: /]$ get /status/system/uptime
 2249376.9921794209

Checking Product Info - IE: Model, Serial, MAC

[admin@DeskRouter: /]$ get /status/product_info/
{
    "company_name": "Cradlepoint, Inc.",
    "company_url": "http://cradlepoint.com",
    "copyright": "Cradlepoint, Inc. 2015",
    "mac0": "00:30:44:1d:83:03",
    "manufacturing": {
        "board_ID": "086000",
        "mftr_date": "20150624",
        "serial_num": "MM150249200234"
    },
    "product_name": "AER3100"
}

Checking the Current Firmware Version

[admin@DeskRouter: /]$ get /status/fw_info/
{
    "build_date": "Mon Nov 30 12:24:18 MST 2015",
    "build_type": "RELEASE",
    "build_version": 16695,
    "custom_defaults": false,
    "fw_update_available": false,
    "major_version": 6,
    "manufacturing_upgrade": false,
    "minor_version": 0,
    "patch_version": 2,
    "upgrade_major_version": 0,
    "upgrade_minor_version": 0,
    "upgrade_patch_version": 0

Show Network Devices and Interfaces:

[admin@DeskRouter: /]$ devices
Device UID:    Type:      Iface:       SubIface:    Zone ID: Network Info:
wan            ethernet   eth0.1       None         3        state: connected, ip: 172.16.4.122/23
4cf41dcb       mdm        pmip27       pmip27       3        state: suspended (310 secs)
4cc65702       mdm        pmip28       pmip28       3        state: configure error
wireless0      wlan       eth1         None         0        network: Primary LAN, ip: fe80::230:44ff:fe1d:8304
wireless0_1    wlan       eth2         None         0        network: Primary LAN, ip: fe80::230:44ff:fe1d:8305
lan            ethernet   eth0.2       None         0        network: Primary LAN, ip: fe80::230:44ff:fe1d:8303
primarylan     ethernet   primarylan7  None         4        ip: 192.168.0.1/24, fe80::2830:44ff:fe1d:8303

Inspect a Directory

[admin@DeskRouter: /]$ inspect /config/system/gps/
Path: /config/system/gps
Name             Type          Current Value                   Default Value                   Params
 -------------------------------------------------------------------------------------------------------
enable_gps_led   boolean       False
pwd_enabled      boolean       False
taip_vehicle_id  string        0000                                                            maxlength: 4, minlength: 4
enabled          boolean       True
connections      array         []                                                              maxlength: 8

Show a System's Current Configuration

[admin@DeskRouter: /]$ get /config/system/gps/
{
    "connections": [],
    "enable_gps_led": false,
    "enabled": true,
    "pwd_enabled": false,
    "taip_vehicle_id": "0000"

Wan Management

Find a WAN Rule

[admin@DeskRouter: /]$ get /config/wan/rules2/*/trigger_string​
 {​
    "/config/wan/rules2/0/trigger_string": "type|is|ethernet",​
    "/config/wan/rules2/1/trigger_string": "type|is|wwan",​
    "/config/wan/rules2/10/trigger_string": "type|is|ethernet%uid|is|wan",​
    "/config/wan/rules2/11/trigger_string": "type|is|ethernet%uid|is|WAN3 - LAB MGMT",​
    "/config/wan/rules2/2/trigger_string": "type|is|mdm%tech|is|lte",​
    "/config/wan/rules2/3/trigger_string": "type|is|mdm%tech|is|lte/3g",​
    "/config/wan/rules2/4/trigger_string": "type|is|mdm%tech|is|3g",​
    "/config/wan/rules2/5/trigger_string": "type|is|mdm%tech|is|lte/3g%uid|is|4bb49342",​
    "/config/wan/rules2/6/trigger_string": "type|is|mdm%tech|is|lte/3g%uid|is|4cf41dcb",​
    "/config/wan/rules2/7/trigger_string": "type|is|ethernet%uid|is|WAN2",​
    "/config/wan/rules2/8/trigger_string": "type|is|mdm%tech|is|lte/3g%uid|is|3feeda4a",​
    "config/wan/rules2/9/trigger_string": "type|is|ethernet%uid|is|WAN2 - DSL"

Current Ethernet Configuration

[admin@DeskRouter: /]$ get /status/wan/devices/ethernet-wan/connectors/​
[​
    {​
        "dhclient_state": "STARTED",​
        "exception": null,​
        "ip6info": null,​
        "ipinfo": {​
            "dnslist": [​
                "172.21.21.97",​
                "172.18.4.254"​
            ],​
            "gateway": "172.16.4.1",​
            "ip_address": "172.16.4.122",​
            "netmask": "255.255.254.0"​
       },​
       "name": "DHCP",​
       "state": "connected",​
       "timeout": null​
   }​
]​

Configure a Static IP - Ethernet Interface

GET the existing rule that has no "static" address.

[admin@DeskRouter: /]$ get /config/wan/rules2/0/

Next, change "ipmode" to "static", add the "*static" addressing. Then in the "triggerstring" use "*" in front of the pipes "|" to make them literal:

"ip_mode": "static",​
"static": {​
"dns": [{​
"ip_address": "8.8.8.8"​
},​
{​
"ip_address": "4.2.2.2"​
}],​
"gateway": "172.16.4.1",​
"ip_address": "172.16.4.122",​
"netmask": "255.255.254.0"​
},​
"trigger_string": "type\|is\|ethernet"

Finnaly we need to "set" a new rule before the new IP address becomes active in the router. You can copy this into you config, ONLY if your wan rules are factory default. If you have previously modified the "wan rules", choose the correct list number and ID. Reference the "NCOS: Command Line Interface (CLI) - Getting Started" for more information.

[admin@DeskRouter: /]$ set /config/wan/rules2/0/ {"_id_": "00000000-
a81d-3590-93ca-8b1fcfeb8e14","bandwidth_egress": 40000,"bandwidth_ingress": 40000,"disabled": false,"failback":
{"immediate": false,"mode": "rate","rate_bandwidth": 20,"rate_time": 90,"time": 90},"failureCheck": 
{"idle_seconds": 30,"mode": "off","retry_count": 5,"retry_interval":
20},"failureCheck6": {"idle_seconds": 30,"mode": "off"},"ip_mode":
"static","loadbalance": false,"modem": {"aggressive_reset": true,"apn_mode":
"default","aux_antenna_enable": true,"connect_mode": "auto","ehrpd_enable":
true,"functional_mode": "ipt","ip_src_wan_subnet_filter": 
true,"lock_net_sos_rssi": -99,"net_sel_mode": "auto"},"static": {"dns":
[{"ip_address": "8.8.8.8"},{"ip_address": "4.2.2.2"}],"gateway":
"172.16.4.1","ip_address": "172.16.4.122","netmask":
"255.255.254.0"},"ondemand": false,"ondemand_idle_minutes":
5,"ondemand_start_connected": true,"priority": 1,"trigger_name":
"Ethernet","trigger_string": "type\|is\|ethernet"}
 

Cellular Wan Management

Check Cellular Singal Strength(RSSI) and SINR Values

For more information on cellular signal values please reference this article.

[admin@DeskRouter: /]$ get /status/wan/devices/mdm*/diagnostics/DBM​
{​
    "/status/wan/devices/mdm-4cc65702/diagnostics/DBM": null,​
    "/status/wan/devices/mdm-4cf41dcb/diagnostics/DBM": "-58"​
}​
[admin@DeskRouter: /]$ get /status/wan/devices/mdm*/diagnostics/SINR​
{​
    "/status/wan/devices/mdm-4cc65702/diagnostics/SINR": null,​
    "/status/wan/devices/mdm-4cf41dcb/diagnostics/SINR": "10.0"

Determine the Carrier

[administrator@AER1600-d59: /]$ get /status/wan/devices/mdm-*/diagnostics/CARRID
{
"/status/wan/devices/mdm-4aa26359/diagnostics/CARRID": "Sprint",
"/status/wan/devices/mdm-4ad02a62/diagnostics/CARRID": null
}

Set the APN

[administrator@AER1600-d59: /]$ get /status/wan/devices/mdm-4cf41dcb/diagnostics/SELAPN                                 
"3"
[administrator@AER1600-d59: /]$ get /status/wan/devices/mdm-4cf41dcb/info/profiles2 (Note: To pull up profile "3", enter profiles2)                             
[
    "apn": "so01.vzwstatic",
    "profile": 3,
    "type": "IP"
]
[administrator@AER1600-d59: set /config/wan/rules2/3/modem/apn_mode "manual"
[administrator@AER1600-d59: set /config/wan/rules2/3/modem/manual_apn "i2gold"
​[administrator@AER1600-d59: set /control/wan/devices/mdn-4cf41dcb/reset true
[administrator@AER1600-d59: /]$ get /status/wan/devices/mdm-4cf41dcb/info/profiles2
[
[   "apn": "i2gold",
    "profile": 3, 
    "type": "IP"
]

Reset Modem

[administrator@AER1600-d59: set /control/wan/devices/mdn-4cf41dcb/reset true
 

WiFi - Using the Wireless Command

[admin@DeskRouter: /]$ help wireless​
    Show the current wireless configuration and status.​
    Usage: wireless [OPTIONS...]​
            -w Print information about enabled Access Point profiles​
            -d Print information about enabled WiFi as WAN / WiFi Bridge profiles​
            -c Print information about currently associated WiFi clients​
            -v Print additional driver specific debug when available​
            -t [CHANNEL] Set wireless channel​
            -k [MAC ADDRESS] Kick wireless client​
            -s [OPTIONAL DWELL TIME] Perform a wireless survey​
            -a [OPTIONAL DWELL TIME] Do a survey and autoselect a channel​
            -r [RADIO] Radio to operate on (0: first, 1: second)​
​
    [admin@DeskRouter: /]$ wireless -s​
    Performing wireless survey​
    Scanning on radio 0...​
    SSID                 BSSID              Mode    ExtCha  RSSI Type       Channel Auth Mode​
    MBR1400-f2b          00:30:44:14:df:2b  b/g/n   none    -81  Infra      1       wpa1wpa2psk/aes​
    AER1600-4c2          00:30:44:1e:e4:c3  b/g/n   none    -76  Infra      1       wpa2psk​
    Mack 2100            02:30:44:17:50:45  b/g/n   none    -72  Infra      1       
    wpa1wpa2psk/aes
 

VPN TroubleShooting - One Tunnel

Enable VPN Service:

[admin@DeskRouter: /]$ set /config/vpn/enable true

VPN Configurations:

 

[admin@DeskRouter: /]$ get /config/vpn/tunnels/0/

VPN is DOWN:​

[admin@DeskRouter: /]$ get /status/vpn/tunnels/*/connections/*/state​
Null​

VPN is UP:​

[admin@DeskRouter: /]$ get /status/vpn/tunnels/*/connections/*/state​
{​
    "/status/vpn/tunnels/0/connections/0/state": "mature",​
    "/status/vpn/tunnels/0/connections/1/state": "mature"​
}​

VPN Debug logging:

[admin@DeskRouter: /]$ set /config/vpn/debug true​
[admin@DeskRouter: /]$ log -f

Troubleshooting Zscaler

View Zscaler TLS Tunnel Configuration:
[admin@DeskRouter: /]$ get /config/webfilter/cloudservice
"zsis"
[admin@DeskRouter: /]$ get /config/webfilter/zsis/tls_tlv/
{
    "cert_uuid": "00000002-4030-4315-ae27-a8818a30c9fb",
    "password": "$1$308e0cda$CAQwm0j09eTCRtZ76VyTIA==",
    "policy_tags": [],
    "port": 443,
    "remote_gateway": "8.34.34.34",
    "user_name": "alext@cpsupport.cradlepoint.com"

Check the Status of Zscaler

Not Connected:

[admin@DeskRouter: /]$ get /status/zsis/status
"none“

Zscaler Connected:

[admin@DeskRouter: /]$ get /status/zsis/status
"tlvauthed"​

Related Articles/Links


Published Date: 07/13/2017

This article not have what you need? Not find what you were looking for? Think this article can be improved? Please let us know at suggestions@cradlepoint.com.

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255