CLI Command Reference

ba port

Gets the UDP port of the Thread Border Agent service.

Parameters

No parameters.

Examples

ba port
49153
Done

CLI and API References

ba state

Gets the otBorderAgentState of the Thread Border Agent role.

Parameters

No parameters.

Examples

ba state
Started
Done

CLI and API References

br (enable,disable)

Enables or disables the Border Routing Manager.

Parameters

No parameters.

Examples

br enable
Done
br disable
Done

CLI and API References

br favoredomrprefix

Gets the currently favored Off-Mesh-Routable (OMR) Prefix.

The favored OMR prefix can be discovered from Network Data or can be this device's local OMR prefix.

Parameters

No parameters.

Examples

br favoredomrprefix
fdfc:1ff5:1512:5622::/64 prf:low
Done

CLI and API References

br nat64prefix

Gets the local NAT64 Prefix of the Border Router.

NAT64 Prefix might not be advertised in the Thread network.

OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE must be enabled.

Parameters

No parameters.

Examples

br nat64prefix
fd14:1078:b3d5:b0b0:0:0::/96
Done

CLI and API References

br omrprefix

Gets the local Off-Mesh-Routable (OMR) Prefix, for example fdfc:1ff5:1512:5622::/64.

An OMR Prefix is a randomly generated 64-bit prefix that's published in the Thread network if there isn't already an OMR prefix. This prefix can be reached from the local Wi-Fi or Ethernet network.

Parameters

No parameters.

Examples

br omrprefix
fdfc:1ff5:1512:5622::/64
Done

CLI and API References

br onlinkprefix

Gets the On-Link Prefix for the adjacent infrastructure link, for example fd41:2650:a6f5:0::/64.

An On-Link Prefix is a 64-bit prefix that's advertised on the infrastructure link if there isn't already a usable on-link prefix being advertised on the link.

Parameters

No parameters.

Examples

br onlinkprefix
fd41:2650:a6f5:0::/64
Done

CLI and API References

br prefixtable

This function iterates over the entries in the Border Router's discovered prefix table.

Parameters

No parameters.

Examples

br prefixtable
prefix:fd00:1234:5678:0::/64, on-link:no, ms-since-rx:29526, lifetime:1800, route-prf:med,
router:ff02:0:0:0:0:0:0:1
prefix:1200:abba:baba:0::/64, on-link:yes, ms-since-rx:29527, lifetime:1800, preferred:1800,
router:ff02:0:0:0:0:0:0:1
Done

CLI and API References

br rioprf (high,med,low)

This function sets the preference to use when advertising Route Info Options in Router Advertisement messages sent over the infrastructure link, for example for discovered OMR prefixes.

By default BR will use medium preference level, but this function allows the default value to be changed. As an example, it can be set to low preference in the case where device is a temporary BR (a mobile BR or a battery-powered BR) to indicate that other BRs (if any) should be preferred over this BR on the infrastructure link.

Parameters

br rioprf [high|med|low]

Examples

br rioprf
med
Done
br rioprf low
Done

CLI and API References

channel (get,set)

Gets or sets the IEEE 802.15.4 Channel value.

Parameters

channel [channel-num]

Use channel-num to set the channel.

Examples

channel
11
Done
channel 11
Done

CLI and API References

  • No associated API

channel manager auto

Enables or disables the auto-channel-selection functionality.

When enabled, ChannelManager will periodically invoke a RequestChannelSelect(false). The period interval can be set by SetAutoChannelSelectionInterval().

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager auto enable

1 is a boolean to enable.

Examples

channel manager auto 1
channel manager auto 1
Done

CLI and API References

channel manager change

Requests a Thread network channel change.

The network switches to the given channel after a specified delay (see otChannelManagerSetDelay()). The channel change is performed by updating the Pending Operational Dataset.

A subsequent call will cancel an ongoing previously requested channel change.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE is required.

Parameters

channel manager change channel-num

Examples

channel manager change 11
channel manager change 11
Done

CLI and API References

channel manager

Get the channel manager state. OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE is required.

Parameters

No parameters.

Examples

channel manager
channel: 11
auto: 1
delay: 120
interval: 10800
supported: { 11-26}
favored: { 11-26}
Done

CLI and API References

channel manager delay

Sets the delay (in seconds) used for a channel change.

The delay should preferably be longer than the maximum data poll interval used by all sleepy-end-devices within the Thread network.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager delay delay-seconds

Examples

channel manager delay 120
channel manager delay 120
Done

CLI and API References

channel manager favored

Sets the favored channel mask.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager favored mask

Examples

channel manager favored 0x7fffc00
channel manager favored 0x7fffc00
Done

CLI and API References

channel manager interval

Sets the period interval (in seconds) used by auto-channel-selection functionality.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager interval interval-seconds

Examples

channel manager interval 10800
channel manager interval 10800
Done

CLI and API References

channel manager select

This function requests that ChannelManager checks and selects a new channel and starts a channel change.

Unlike the otChannelManagerRequestChannelChange() where the channel must be given as a parameter, this function asks the ChannelManager to select a channel by itself (based on collected channel quality info).

Once called, the Channel Manager will perform the following 3 steps:

1) ChannelManager decides if the channel change would be helpful. This check can be skipped if aSkipQualityCheck is set to true (forcing a channel selection to happen and skipping the quality check). This step uses the collected link quality metrics on the device (such as CCA failure rate, frame and message error rates per neighbor, etc.) to determine if the current channel quality is at the level that justifies a channel change.

2) If the first step passes, then ChannelManager selects a potentially better channel. It uses the collected channel quality data by ChannelMonitor module. The supported and favored channels are used at this step. (see otChannelManagerSetSupportedChannels() and otChannelManagerSetFavoredChannels()).

3) If the newly selected channel is different from the current channel, ChannelManager requests/starts the channel change process (internally invoking a RequestChannelChange()).

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager select skip-quality-check

Use a 1 or 0 for the boolean skip-quality-check.

Examples

channel manager select 1
channel manager select 1
Done

CLI and API References

channel manager supported

Sets the supported channel mask.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager supported mask

Examples

channel manager supported 0x7fffc00
channel manager supported 0x7fffc00
Done

CLI and API References

channel manager threshold

Sets the CCA failure rate threshold.

OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE and OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE are required.

Parameters

channel manager threshold threshold-percent

Use a hex value for threshold-percent. 0 maps to 0% and 0xffff maps to 100%.

Examples

channel manager threshold 0xffff
channel manager threshold 0xffff
Done

CLI and API References

channel monitor

Get the current channel monitor state and channel occupancy. OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE is required.

Parameters

No parameters.

Examples

channel monitor
enabled: 1
interval: 41000
threshold: -75
window: 960
count: 10552
occupancies:
ch 11 (0x0cb7)  4.96% busy
ch 12 (0x2e2b) 18.03% busy
ch 13 (0x2f54) 18.48% busy
ch 14 (0x0fef)  6.22% busy
ch 15 (0x1536)  8.28% busy
ch 16 (0x1746)  9.09% busy
ch 17 (0x0b8b)  4.50% busy
ch 18 (0x60a7) 37.75% busy
ch 19 (0x0810)  3.14% busy
ch 20 (0x0c2a)  4.75% busy
ch 21 (0x08dc)  3.46% busy
ch 22 (0x101d)  6.29% busy
ch 23 (0x0092)  0.22% busy
ch 24 (0x0028)  0.06% busy
ch 25 (0x0063)  0.15% busy
ch 26 (0x058c)  2.16% busy
Done

CLI and API References

  • No associated API

channel monitor start

Start the channel monitor. OT CLI sends a boolean value of true to otChannelMonitorSetEnabled. OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE is required.

Parameters

No parameters.

Examples

channel monitor start
channel monitor start
Done

CLI and API References

channel monitor stop

Stop the channel monitor. OT CLI sends a boolean value of false to otChannelMonitorSetEnabled. OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE is required.

Parameters

No parameters.

Examples

channel monitor stop
channel monitor stop
Done

CLI and API References

channel preferred

Gets the radio preferred channel mask that the device prefers to form on.

Parameters

No parameters.

Examples

channel preferred
0x7fff800
Done

CLI and API References

channel supported

Get the radio supported channel mask that the device is allowed to be on.

Parameters

No parameters.

Examples

channel supported
0x7fff800
Done

CLI and API References

contextreusedelay (get,set)

Gets or sets the CONTEXT_ID_REUSE_DELAY value.

Parameters

contextreusedelay delay

Use the optional delay argument to set the CONTEXT_ID_REUSE_DELAY.

Examples

contextreusedelay
11
Done
contextreusedelay 11
Done

CLI and API References

counters (mac)

Get the MAC layer counters.

Parameters

counters mac

Examples

counters mac
TxTotal: 10
   TxUnicast: 3
   TxBroadcast: 7
   TxAckRequested: 3
   TxAcked: 3
   TxNoAckRequested: 7
   TxData: 10
   TxDataPoll: 0
   TxBeacon: 0
   TxBeaconRequest: 0
   TxOther: 0
   TxRetry: 0
   TxErrCca: 0
   TxErrBusyChannel: 0
RxTotal: 2
   RxUnicast: 1
   RxBroadcast: 1
   RxData: 2
   RxDataPoll: 0
   RxBeacon: 0
   RxBeaconRequest: 0
   RxOther: 0
   RxAddressFiltered: 0
   RxDestAddrFiltered: 0
   RxDuplicated: 0
   RxErrNoFrame: 0
   RxErrNoUnknownNeighbor: 0
   RxErrInvalidSrcAddr: 0
   RxErrSec: 0
   RxErrFcs: 0
   RxErrOther: 0
Done

CLI and API References

counters (mle)

Gets the Thread MLE counters.

Parameters

counters mle

Examples

counters mle
Role Disabled: 0
Role Detached: 1
Role Child: 0
Role Router: 0
Role Leader: 1
Attach Attempts: 1
Partition Id Changes: 1
Better Partition Attach Attempts: 0
Parent Changes: 0
Done

CLI and API References

counters

Gets the supported counter names.

Parameters

No parameters.

Examples

counters
ip
mac
mle
Done

CLI and API References

  • No associated API

counters ip

Gets the IPv6 counters.

Parameters

counters ip

Examples

counters ip
TxSuccess: 10
TxFailed: 0
RxSuccess: 5
RxFailed: 0
Done

CLI and API References

counters ip reset

Resets the IPv6 counters.

Parameters

counters ip reset

Examples

counters ip reset
Done

CLI and API References

counters mac reset

Resets the MAC layer counters.

Parameters

counters mac reset

Examples

counters mac reset
Done

CLI and API References

counters mle reset

Resets the Thread MLE counters.

Parameters

counters mle reset

Examples

counters mle reset
Done

CLI and API References

csl channel

Sets the CSL channel.

Parameters

csl channel channel

Examples

csl channel 20
Done

CLI and API References

csl

Gets the CSL configuration.

Parameters

No parameters.

Examples

csl
Channel: 11
Period: 1000 (in units of 10 symbols), 160ms
Timeout: 1000s
Done

CLI and API References

csl period

Sets the CSL period in units of 10 symbols.

Disable CSL by setting this parameter to 0.

Parameters

csl period period

Examples

csl period 3000
Done

CLI and API References

csl timeout

Sets the CSL timeout in seconds.

Parameters

csl timeout timeout

Examples

cls timeout 10
Done

CLI and API References

eui64

Gets the factory-assigned IEEE EUI-64 for this interface.

Parameters

No parameters.

Examples

eui64
0615aae900124b00
Done

CLI and API References

joiner discerner (set)

Sets the Joiner Discerner.

Parameters

joiner discerner discerner
  • Use {number}/{length} to set the discerner.
  • joiner discerner clear sets aDiscerner to nullptr.

Examples

joiner discerner 0xabc/12
Done

CLI and API References

joiner discerner clear

Clear the Joiner discerner.

Parameters

No parameters.

Examples

joiner discerner clear
Done

CLI and API References

  • No associated API

joiner discerner

Gets the Joiner Discerner.

For more information, refer to otJoinerSetDiscerner.

Parameters

No parameters.

Examples

joiner discerner
0xabc/12
Done

CLI and API References

joiner help

Print the joiner help menu.

Parameters

No parameters.

Examples

joiner help
help
id
start
state
stop
Done

CLI and API References

  • No associated API

joiner id

Gets the Joiner ID.

If a Joiner Discerner is not set, Joiner ID is the first 64 bits of the result of computing SHA-256 over factory-assigned IEEE EUI-64. Otherwise the Joiner ID is calculated from the Joiner Discerner value.

The Joiner ID is also used as the device's IEEE 802.15.4 Extended Address during the commissioning process.

Parameters

No parameters.

Examples

joiner id
d65e64fa83f81cf7
Done

CLI and API References

joiner start

Enables the Thread Joiner role.

Parameters

joiner start joining-device-credential [provisioning-url]
  • joining-device-credential: Joiner Passphrase. Must be a string of all uppercase alphanumeric characters (0-9 and A-Y, excluding I, O, Q, and Z for readability), with a length between 6 and 32 characters.
  • provisioning-url: Provisioning URL for the Joiner (optional).

Examples

joiner start J01NM3
Done

CLI and API References

joiner state

Gets the Joiner State.

Returns one of the following states:

  • Idle
  • Discover
  • Connecting
  • Connected
  • Entrust
  • Joined

Parameters

No parameters.

Examples

joiner state
Idle
Done

CLI and API References

joiner stop

Disables the Thread Joiner role.

Parameters

No parameters.

Examples

joiner stop
Done

CLI and API References

netdata help

Gets a list of netdata CLI commands.

Parameters

No parameters.

Examples

netdata help
help
publish
register
show
steeringdata
unpublish
Done

CLI and API References

netdata publish dnssrp anycast

Publishes a DNS/SRP Service Anycast Address with a sequence number. Any current DNS/SRP Service entry being published from a previous publish dnssrp{anycast|unicast} command is removed and replaced with the new arguments.

OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE must be enabled.

Parameters

netdata publish dnssrp anycast seq-num

Examples

netdata publish dnssrp anycast 1
Done

CLI and API References

netdata publish dnssrp unicast (addr,port)

Publishes a DNS/SRP Service Unicast Address with an address and port number. The address and port information is included in Service TLV data. Any current DNS/SRP Service entry being published from a previous publish dnssrp{anycast|unicast} command is removed and replaced with the new arguments.

OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE must be enabled.

Parameters

netdata publish dnssrp unicast address port

Examples

netdata publish dnssrp unicast fd00::1234 51525
Done

CLI and API References

netdata publish dnssrp unicast (mle)

Publishes the device's Mesh-Local EID with a port number. MLE and port information is included in the Server TLV data. To use a different Unicast address, use the netdata publish dnssrp unicast (addr,port) command.

Any current DNS/SRP Service entry being published from a previous publish dnssrp{anycast|unicast} command is removed and replaced with the new arguments.

OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE must be enabled.

Parameters

netdata publish dnssrp unicast port

Examples

netdata publish dnssrp unicast 50152
Done

CLI and API References

netdata publish prefix

Publish an on-mesh prefix entry. For more information, refer to Display and Manage Network Data with OT CLI.

Parameters

netdata publish prefix prefix [padcrosnD] [high|med|low]

OT CLI uses mapped arguments to configure otBorderRouterConfig values. For more information, refer to the OpenThread CLI Overview.

Examples

netdata publish prefix fd00:1234:5678::/64 paos med
Done

CLI and API References

netdata publish route

Publish an external route entry. For more information, refer to Display and Manage Network Data with OT CLI.

Parameters

publish route prefix [sn] [high|med|low]

OT CLI uses mapped arguments to configure otExternalRouteConfig values. For more information, refer to the OpenThread CLI Overview.

Examples

netdata publish route fd00:1234:5678::/64 s high
Done

CLI and API References

netdata register

Register configured prefixes, routes, and services with the Leader.

OT CLI checks for OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE. If OTBR is enabled, it registers local Network Data with the Leader. Otherwise, it calls the CLI function otServerRegister. For more information, refer to Display and Manage Network Data with OT CLI.

Parameters

No parameters.

Examples

netdata register
Done

CLI and API References

netdata show local

Print local Network Data to sync with the Leader.

Parameters

netdata show local [-x]
  • The optional -x argument gets local Network Data as hex-encoded TLVs.

Examples

netdata show local
Prefixes:
fd00:dead:beef:cafe::/64 paros med dc00
Routes:
Services:
Done
netdata show local -x
08040b02174703140040fd00deadbeefcafe0504dc00330007021140
Done

CLI and API References

netdata show

netdata show from OT CLI gets full Network Data received from the Leader. This command uses several API functions to combine prefixes, routes, and services, including otNetDataGetNextOnMeshPrefix, otNetDataGetNextRoute, and otNetDataGetNextService.

For more information, refer to Display and Manage Network Data with OT CLI.

Parameters

netdata show [-x]
  • The optional -x argument gets Network Data as hex-encoded TLVs.

Examples

netdata show
Prefixes:
fd00:dead:beef:cafe::/64 paros med dc00
Routes:
fd49:7770:7fc5:0::/64 s med 4000
Services:
44970 5d c000 s 4000
44970 01 9a04b000000e10 s 4000
Done
netdata show -x
08040b02174703140040fd00deadbeefcafe0504dc00330007021140
Done

CLI and API References

netdata steeringdata check (discerner)

Check if the steering data includes a Joiner with a given discerner value.

Parameters

netdata steeringdata check discerner
  • discerner: The Joiner discerner in format {number}/{length}.

Examples

netdata steeringdata check 0xabc/12
Done
netdata steeringdata check 0xdef/12
Error 23: NotFound

CLI and API References

netdata steeringdata check (eui64)

Check if the steering data includes a Joiner.

Parameters

netdata steeringdata check eui64
  • eui64: The IEEE EUI-64 of the Joiner.

Examples

netdata steeringdata check d45e64fa83f81cf7
Done

CLI and API References

netdata unpublish (prefix)

Unpublishes a previously published On-Mesh or External Route Prefix.

OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE must be enabled.

For more information, refer to Display and Manage Network Data with OT CLI.

Parameters

netdata unpublish prefix

Examples

netdata unpublish fd00:1234:5678::/64
Done

CLI and API References

netdata unpublish dnssrp

Unpublishes any previously added DNS/SRP (Anycast or Unicast) Service entry from the Thread Network Data.

OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE must be enabled.

Parameters

No parameters.

Examples

netdata unpublish dnssrp
Done

CLI and API References

prefix add

Adds a valid prefix to the Network Data.

Parameters

prefix add prefix [padcrosnD] [high|med|low]

OT CLI uses mapped arguments to configure otBorderRouterConfig values. For more information, refer to the OpenThread CLI Overview.

Examples

prefix add 2001:dead:beef:cafe::/64 paros med
Done
prefix add fd00:7d03:7d03:7d03::/64 prosD low
Done

CLI and API References

prefix meshlocal

Get the mesh local prefix.

Parameters

No parameters.

Examples

prefix meshlocal
fdde:ad00:beef:0::/64
Done

CLI and API References

  • No associated API

prefix

Get the prefix list in the local Network Data.

For more information about otBorderRouterConfig flags, refer to OpenThread CLI Overview.

Parameters

No parameters.

Examples

prefix
2001:dead:beef:cafe::/64 paros med
- fd00:7d03:7d03:7d03::/64 prosD med
Done

CLI and API References

prefix remove

Remove a border router configuration from the local network data.

Parameters

No parameters.

Examples

prefix remove 2001:dead:beef:cafe::/64
Done

CLI and API References