1*cfb92d14SAndroid Build Coastguard Worker# OpenThread CLI - Network Data 2*cfb92d14SAndroid Build Coastguard Worker 3*cfb92d14SAndroid Build Coastguard Worker## Overview 4*cfb92d14SAndroid Build Coastguard Worker 5*cfb92d14SAndroid Build Coastguard WorkerThread Network Data contains information about Border Routers and other servers available in the Thread network. Border Routers and devices offering services register their information with the Leader. The Leader collects and structures this information within the Thread Network Data and distributes the information to all devices in the Thread Network. 6*cfb92d14SAndroid Build Coastguard Worker 7*cfb92d14SAndroid Build Coastguard WorkerBorder Routers may register prefixes assigned to the Thread Network and prefixes that they offer routes for. Services may register any information relevant to the service itself. 8*cfb92d14SAndroid Build Coastguard Worker 9*cfb92d14SAndroid Build Coastguard WorkerBorder Router and service information may be stable or temporary. Stable Thread Network Data is distributed to all devices, including Sleepy End Devices (SEDs). Temporary Network Data is distributed to all nodes except SEDs. 10*cfb92d14SAndroid Build Coastguard Worker 11*cfb92d14SAndroid Build Coastguard Worker## Quick Start 12*cfb92d14SAndroid Build Coastguard Worker 13*cfb92d14SAndroid Build Coastguard Worker### Form Network and Configure Prefix 14*cfb92d14SAndroid Build Coastguard Worker 15*cfb92d14SAndroid Build Coastguard Worker1. Generate and view new network configuration. 16*cfb92d14SAndroid Build Coastguard Worker 17*cfb92d14SAndroid Build Coastguard Worker ```bash 18*cfb92d14SAndroid Build Coastguard Worker > dataset init new 19*cfb92d14SAndroid Build Coastguard Worker Done 20*cfb92d14SAndroid Build Coastguard Worker > dataset 21*cfb92d14SAndroid Build Coastguard Worker Active Timestamp: 1 22*cfb92d14SAndroid Build Coastguard Worker Channel: 13 23*cfb92d14SAndroid Build Coastguard Worker Channel Mask: 0x07fff800 24*cfb92d14SAndroid Build Coastguard Worker Ext PAN ID: d63e8e3e495ebbc3 25*cfb92d14SAndroid Build Coastguard Worker Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 26*cfb92d14SAndroid Build Coastguard Worker Network Key: dfd34f0f05cad978ec4e32b0413038ff 27*cfb92d14SAndroid Build Coastguard Worker Network Name: OpenThread-8f28 28*cfb92d14SAndroid Build Coastguard Worker PAN ID: 0x8f28 29*cfb92d14SAndroid Build Coastguard Worker PSKc: c23a76e98f1a6483639b1ac1271e2e27 30*cfb92d14SAndroid Build Coastguard Worker Security Policy: 0, onrc 31*cfb92d14SAndroid Build Coastguard Worker Done 32*cfb92d14SAndroid Build Coastguard Worker ``` 33*cfb92d14SAndroid Build Coastguard Worker 34*cfb92d14SAndroid Build Coastguard Worker2. Commit new dataset to the Active Operational Dataset in non-volatile storage. 35*cfb92d14SAndroid Build Coastguard Worker 36*cfb92d14SAndroid Build Coastguard Worker ```bash 37*cfb92d14SAndroid Build Coastguard Worker dataset commit active 38*cfb92d14SAndroid Build Coastguard Worker Done 39*cfb92d14SAndroid Build Coastguard Worker ``` 40*cfb92d14SAndroid Build Coastguard Worker 41*cfb92d14SAndroid Build Coastguard Worker3. Enable Thread interface 42*cfb92d14SAndroid Build Coastguard Worker 43*cfb92d14SAndroid Build Coastguard Worker ```bash 44*cfb92d14SAndroid Build Coastguard Worker > ifconfig up 45*cfb92d14SAndroid Build Coastguard Worker Done 46*cfb92d14SAndroid Build Coastguard Worker > thread start 47*cfb92d14SAndroid Build Coastguard Worker Done 48*cfb92d14SAndroid Build Coastguard Worker ``` 49*cfb92d14SAndroid Build Coastguard Worker 50*cfb92d14SAndroid Build Coastguard Worker4. Observe IPv6 addresses assigned to the Thread interface. 51*cfb92d14SAndroid Build Coastguard Worker 52*cfb92d14SAndroid Build Coastguard Worker ```bash 53*cfb92d14SAndroid Build Coastguard Worker > ipaddr 54*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:fc00 55*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:dc00 56*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:393c:462d:e8d2:db32 57*cfb92d14SAndroid Build Coastguard Worker fe80:0:0:0:a40b:197f:593d:ca61 58*cfb92d14SAndroid Build Coastguard Worker Done 59*cfb92d14SAndroid Build Coastguard Worker ``` 60*cfb92d14SAndroid Build Coastguard Worker 61*cfb92d14SAndroid Build Coastguard Worker5. Register an IPv6 prefix assigned to the Thread network. 62*cfb92d14SAndroid Build Coastguard Worker 63*cfb92d14SAndroid Build Coastguard Worker ```bash 64*cfb92d14SAndroid Build Coastguard Worker > prefix add fd00:dead:beef:cafe::/64 paros 65*cfb92d14SAndroid Build Coastguard Worker Done 66*cfb92d14SAndroid Build Coastguard Worker > netdata register 67*cfb92d14SAndroid Build Coastguard Worker Done 68*cfb92d14SAndroid Build Coastguard Worker ``` 69*cfb92d14SAndroid Build Coastguard Worker 70*cfb92d14SAndroid Build Coastguard Worker6. Observe Thread Network Data. 71*cfb92d14SAndroid Build Coastguard Worker 72*cfb92d14SAndroid Build Coastguard Worker ```bash 73*cfb92d14SAndroid Build Coastguard Worker > netdata show 74*cfb92d14SAndroid Build Coastguard Worker Prefixes: 75*cfb92d14SAndroid Build Coastguard Worker fd00:dead:beef:cafe::/64 paros med dc00 76*cfb92d14SAndroid Build Coastguard Worker Routes: 77*cfb92d14SAndroid Build Coastguard Worker Services: 78*cfb92d14SAndroid Build Coastguard Worker Done 79*cfb92d14SAndroid Build Coastguard Worker ``` 80*cfb92d14SAndroid Build Coastguard Worker 81*cfb92d14SAndroid Build Coastguard Worker7. Observe IPv6 addresses assigned to the Thread interface. 82*cfb92d14SAndroid Build Coastguard Worker 83*cfb92d14SAndroid Build Coastguard Worker ```bash 84*cfb92d14SAndroid Build Coastguard Worker > ipaddr 85*cfb92d14SAndroid Build Coastguard Worker fd00:dead:beef:cafe:4da8:5234:4aa2:4cfa 86*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:fc00 87*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:dc00 88*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:393c:462d:e8d2:db32 89*cfb92d14SAndroid Build Coastguard Worker fe80:0:0:0:a40b:197f:593d:ca61 90*cfb92d14SAndroid Build Coastguard Worker Done 91*cfb92d14SAndroid Build Coastguard Worker ``` 92*cfb92d14SAndroid Build Coastguard Worker 93*cfb92d14SAndroid Build Coastguard Worker### Attach to Existing Network 94*cfb92d14SAndroid Build Coastguard Worker 95*cfb92d14SAndroid Build Coastguard WorkerOnly the Network Key is required for a device to attach to a Thread network. 96*cfb92d14SAndroid Build Coastguard Worker 97*cfb92d14SAndroid Build Coastguard WorkerWhile not required, specifying the channel avoids the need to search across multiple channels, improving both latency and efficiency of the attach process. 98*cfb92d14SAndroid Build Coastguard Worker 99*cfb92d14SAndroid Build Coastguard WorkerAfter the device successfully attaches to a Thread network, the device will retrieve the complete Active Operational Dataset. 100*cfb92d14SAndroid Build Coastguard Worker 101*cfb92d14SAndroid Build Coastguard Worker1. Create a partial Active Operational Dataset. 102*cfb92d14SAndroid Build Coastguard Worker 103*cfb92d14SAndroid Build Coastguard Worker ```bash 104*cfb92d14SAndroid Build Coastguard Worker > dataset networkkey dfd34f0f05cad978ec4e32b0413038ff 105*cfb92d14SAndroid Build Coastguard Worker Done 106*cfb92d14SAndroid Build Coastguard Worker > dataset commit active 107*cfb92d14SAndroid Build Coastguard Worker Done 108*cfb92d14SAndroid Build Coastguard Worker ``` 109*cfb92d14SAndroid Build Coastguard Worker 110*cfb92d14SAndroid Build Coastguard Worker2. Enable Thread interface. 111*cfb92d14SAndroid Build Coastguard Worker 112*cfb92d14SAndroid Build Coastguard Worker ```bash 113*cfb92d14SAndroid Build Coastguard Worker > ifconfig up 114*cfb92d14SAndroid Build Coastguard Worker Done 115*cfb92d14SAndroid Build Coastguard Worker > thread start 116*cfb92d14SAndroid Build Coastguard Worker Done 117*cfb92d14SAndroid Build Coastguard Worker ``` 118*cfb92d14SAndroid Build Coastguard Worker 119*cfb92d14SAndroid Build Coastguard Worker3. After attaching, observe Thread Network Data. 120*cfb92d14SAndroid Build Coastguard Worker 121*cfb92d14SAndroid Build Coastguard Worker ```bash 122*cfb92d14SAndroid Build Coastguard Worker > netdata show 123*cfb92d14SAndroid Build Coastguard Worker Prefixes: 124*cfb92d14SAndroid Build Coastguard Worker fd00:dead:beef:cafe::/64 paros med dc00 125*cfb92d14SAndroid Build Coastguard Worker Routes: 126*cfb92d14SAndroid Build Coastguard Worker Services: 127*cfb92d14SAndroid Build Coastguard Worker Done 128*cfb92d14SAndroid Build Coastguard Worker ``` 129*cfb92d14SAndroid Build Coastguard Worker 130*cfb92d14SAndroid Build Coastguard Worker4. Observe IPv6 addresses assigned to the Thread interface. 131*cfb92d14SAndroid Build Coastguard Worker 132*cfb92d14SAndroid Build Coastguard Worker ```bash 133*cfb92d14SAndroid Build Coastguard Worker > ipaddr 134*cfb92d14SAndroid Build Coastguard Worker fd00:dead:beef:cafe:4da8:5234:4aa2:4cfa 135*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:fc00 136*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:0:ff:fe00:dc00 137*cfb92d14SAndroid Build Coastguard Worker fd3d:b50b:f96d:722d:393c:462d:e8d2:db32 138*cfb92d14SAndroid Build Coastguard Worker fe80:0:0:0:a40b:197f:593d:ca61 139*cfb92d14SAndroid Build Coastguard Worker Done 140*cfb92d14SAndroid Build Coastguard Worker ``` 141*cfb92d14SAndroid Build Coastguard Worker 142*cfb92d14SAndroid Build Coastguard Worker## Command List 143*cfb92d14SAndroid Build Coastguard Worker 144*cfb92d14SAndroid Build Coastguard Worker- [help](#help) 145*cfb92d14SAndroid Build Coastguard Worker- [full](#full) 146*cfb92d14SAndroid Build Coastguard Worker- [length](#length) 147*cfb92d14SAndroid Build Coastguard Worker- [maxlength](#maxlength) 148*cfb92d14SAndroid Build Coastguard Worker- [publish](#publish) 149*cfb92d14SAndroid Build Coastguard Worker- [register](#register) 150*cfb92d14SAndroid Build Coastguard Worker- [show](#show) 151*cfb92d14SAndroid Build Coastguard Worker- [steeringdata](#steeringdata-check-eui64discerner) 152*cfb92d14SAndroid Build Coastguard Worker- [unpublish](#unpublish) 153*cfb92d14SAndroid Build Coastguard Worker 154*cfb92d14SAndroid Build Coastguard Worker## Command Details 155*cfb92d14SAndroid Build Coastguard Worker 156*cfb92d14SAndroid Build Coastguard Worker### help 157*cfb92d14SAndroid Build Coastguard Worker 158*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata help` 159*cfb92d14SAndroid Build Coastguard Worker 160*cfb92d14SAndroid Build Coastguard WorkerPrint netdata help menu. 161*cfb92d14SAndroid Build Coastguard Worker 162*cfb92d14SAndroid Build Coastguard Worker```bash 163*cfb92d14SAndroid Build Coastguard Worker> netdata help 164*cfb92d14SAndroid Build Coastguard Workerfull 165*cfb92d14SAndroid Build Coastguard Workerlength 166*cfb92d14SAndroid Build Coastguard Workermaxlength 167*cfb92d14SAndroid Build Coastguard Workerpublish 168*cfb92d14SAndroid Build Coastguard Workerregister 169*cfb92d14SAndroid Build Coastguard Workershow 170*cfb92d14SAndroid Build Coastguard Workersteeringdata 171*cfb92d14SAndroid Build Coastguard Workerunpublish 172*cfb92d14SAndroid Build Coastguard WorkerDone 173*cfb92d14SAndroid Build Coastguard Worker``` 174*cfb92d14SAndroid Build Coastguard Worker 175*cfb92d14SAndroid Build Coastguard Worker### full 176*cfb92d14SAndroid Build Coastguard Worker 177*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata full` 178*cfb92d14SAndroid Build Coastguard Worker 179*cfb92d14SAndroid Build Coastguard WorkerPrint "yes" or "no" flag tracking whether or not the "net data full" callback has been invoked since start of Thread operation or since the last time `netdata full reset` was used to reset the flag. 180*cfb92d14SAndroid Build Coastguard Worker 181*cfb92d14SAndroid Build Coastguard WorkerThis command requires `OPENTHREAD_CONFIG_BORDER_ROUTER_SIGNAL_NETWORK_DATA_FULL`. 182*cfb92d14SAndroid Build Coastguard Worker 183*cfb92d14SAndroid Build Coastguard WorkerThe "net data full" callback is invoked whenever: 184*cfb92d14SAndroid Build Coastguard Worker 185*cfb92d14SAndroid Build Coastguard Worker- The device is acting as a leader and receives a Network Data registration from a Border Router (BR) that it cannot add to Network Data (running out of space). 186*cfb92d14SAndroid Build Coastguard Worker- The device is acting as a BR and new entries cannot be added to its local Network Data. 187*cfb92d14SAndroid Build Coastguard Worker- The device is acting as a BR and tries to register its local Network Data entries with the leader, but determines that its local entries will not fit. 188*cfb92d14SAndroid Build Coastguard Worker 189*cfb92d14SAndroid Build Coastguard Worker``` 190*cfb92d14SAndroid Build Coastguard Worker> netdata full 191*cfb92d14SAndroid Build Coastguard Workerno 192*cfb92d14SAndroid Build Coastguard WorkerDone 193*cfb92d14SAndroid Build Coastguard Worker``` 194*cfb92d14SAndroid Build Coastguard Worker 195*cfb92d14SAndroid Build Coastguard Worker### full reset 196*cfb92d14SAndroid Build Coastguard Worker 197*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata full reset` 198*cfb92d14SAndroid Build Coastguard Worker 199*cfb92d14SAndroid Build Coastguard WorkerReset the flag tracking whether "net data full" callback was invoked. 200*cfb92d14SAndroid Build Coastguard Worker 201*cfb92d14SAndroid Build Coastguard WorkerThis command requires `OPENTHREAD_CONFIG_BORDER_ROUTER_SIGNAL_NETWORK_DATA_FULL`. 202*cfb92d14SAndroid Build Coastguard Worker 203*cfb92d14SAndroid Build Coastguard Worker``` 204*cfb92d14SAndroid Build Coastguard Worker> netdata full reset 205*cfb92d14SAndroid Build Coastguard WorkerDone 206*cfb92d14SAndroid Build Coastguard Worker``` 207*cfb92d14SAndroid Build Coastguard Worker 208*cfb92d14SAndroid Build Coastguard Worker### length 209*cfb92d14SAndroid Build Coastguard Worker 210*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata length` 211*cfb92d14SAndroid Build Coastguard Worker 212*cfb92d14SAndroid Build Coastguard WorkerGet the current length of (number of bytes) Partition's Thread Network Data. 213*cfb92d14SAndroid Build Coastguard Worker 214*cfb92d14SAndroid Build Coastguard Worker```bash 215*cfb92d14SAndroid Build Coastguard Worker> netdata length 216*cfb92d14SAndroid Build Coastguard Worker23 217*cfb92d14SAndroid Build Coastguard WorkerDone 218*cfb92d14SAndroid Build Coastguard Worker``` 219*cfb92d14SAndroid Build Coastguard Worker 220*cfb92d14SAndroid Build Coastguard Worker### maxlength 221*cfb92d14SAndroid Build Coastguard Worker 222*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata maxlength` 223*cfb92d14SAndroid Build Coastguard Worker 224*cfb92d14SAndroid Build Coastguard WorkerGet the maximum observed length of the Thread Network Data since OT stack initialization or since the last call to `netdata maxlength reset`. 225*cfb92d14SAndroid Build Coastguard Worker 226*cfb92d14SAndroid Build Coastguard Worker```bash 227*cfb92d14SAndroid Build Coastguard Worker> netdata maxlength 228*cfb92d14SAndroid Build Coastguard Worker40 229*cfb92d14SAndroid Build Coastguard WorkerDone 230*cfb92d14SAndroid Build Coastguard Worker``` 231*cfb92d14SAndroid Build Coastguard Worker 232*cfb92d14SAndroid Build Coastguard Worker### maxlength reset 233*cfb92d14SAndroid Build Coastguard Worker 234*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata maxlength reset` 235*cfb92d14SAndroid Build Coastguard Worker 236*cfb92d14SAndroid Build Coastguard WorkerReset the tracked maximum length of the Thread Network Data. 237*cfb92d14SAndroid Build Coastguard Worker 238*cfb92d14SAndroid Build Coastguard Worker```bash 239*cfb92d14SAndroid Build Coastguard Worker> netdata maxlength reset 240*cfb92d14SAndroid Build Coastguard WorkerDone 241*cfb92d14SAndroid Build Coastguard Worker``` 242*cfb92d14SAndroid Build Coastguard Worker 243*cfb92d14SAndroid Build Coastguard Worker### publish 244*cfb92d14SAndroid Build Coastguard Worker 245*cfb92d14SAndroid Build Coastguard WorkerThe Network Data Publisher provides mechanisms to limit the number of similar Service and/or Prefix (on-mesh prefix or external route) entries in the Thread Network Data by monitoring the Network Data and managing if or when to add or remove entries. 246*cfb92d14SAndroid Build Coastguard Worker 247*cfb92d14SAndroid Build Coastguard WorkerThe Publisher requires `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE`. 248*cfb92d14SAndroid Build Coastguard Worker 249*cfb92d14SAndroid Build Coastguard Worker### publish dnssrp 250*cfb92d14SAndroid Build Coastguard Worker 251*cfb92d14SAndroid Build Coastguard WorkerPublish DNS/SRP service entry. 252*cfb92d14SAndroid Build Coastguard Worker 253*cfb92d14SAndroid Build Coastguard WorkerThis command requires `OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE`. 254*cfb92d14SAndroid Build Coastguard Worker 255*cfb92d14SAndroid Build Coastguard WorkerThe following formats are available: : 256*cfb92d14SAndroid Build Coastguard Worker 257*cfb92d14SAndroid Build Coastguard Worker- `netdata publish dnssrp anycast <seq-num>` to publish "DNS/SRP Service Anycast Address" with a given sequence number. 258*cfb92d14SAndroid Build Coastguard Worker- `netdata publish dnssrp unicast <address> <port>` to publish "DNS/SRP Service Unicast Address" with given address and port number info. The address/port info is included in Service TLV data. 259*cfb92d14SAndroid Build Coastguard Worker- `netdata publish dnssrp unicast <port>` to publish "DNS/SRP Service Unicast Address" with given port number and the device's mesh-local EID for the address. The address and port info is included in Server TLV data. 260*cfb92d14SAndroid Build Coastguard Worker 261*cfb92d14SAndroid Build Coastguard WorkerA new call to `netdata publish dnssrp [anycast|unicast] [...]` command will remove and replace any previous "DNS/SRP Service" entry that was being published (from earlier `netdata publish dnssrp [...]` commands). 262*cfb92d14SAndroid Build Coastguard Worker 263*cfb92d14SAndroid Build Coastguard Worker```bash 264*cfb92d14SAndroid Build Coastguard Worker> netdata publish dnssrp anycast 1 265*cfb92d14SAndroid Build Coastguard WorkerDone 266*cfb92d14SAndroid Build Coastguard Worker 267*cfb92d14SAndroid Build Coastguard Worker> netdata publish dnssrp unicast fd00::1234 51525 268*cfb92d14SAndroid Build Coastguard WorkerDone 269*cfb92d14SAndroid Build Coastguard Worker 270*cfb92d14SAndroid Build Coastguard Worker> netdata publish dnssrp unicast 50152 271*cfb92d14SAndroid Build Coastguard WorkerDone 272*cfb92d14SAndroid Build Coastguard Worker``` 273*cfb92d14SAndroid Build Coastguard Worker 274*cfb92d14SAndroid Build Coastguard Worker### publish prefix \<prefix\> [padcrosnD][prf] 275*cfb92d14SAndroid Build Coastguard Worker 276*cfb92d14SAndroid Build Coastguard WorkerPublish an on-mesh prefix entry. 277*cfb92d14SAndroid Build Coastguard Worker 278*cfb92d14SAndroid Build Coastguard Worker- p: Preferred flag 279*cfb92d14SAndroid Build Coastguard Worker- a: Stateless IPv6 Address Autoconfiguration flag 280*cfb92d14SAndroid Build Coastguard Worker- d: DHCPv6 IPv6 Address Configuration flag 281*cfb92d14SAndroid Build Coastguard Worker- c: DHCPv6 Other Configuration flag 282*cfb92d14SAndroid Build Coastguard Worker- r: Default Route flag 283*cfb92d14SAndroid Build Coastguard Worker- o: On Mesh flag 284*cfb92d14SAndroid Build Coastguard Worker- s: Stable flag 285*cfb92d14SAndroid Build Coastguard Worker- n: Nd Dns flag 286*cfb92d14SAndroid Build Coastguard Worker- D: Domain Prefix flag (only available for Thread 1.2). 287*cfb92d14SAndroid Build Coastguard Worker- prf: Preference, which may be 'high', 'med', or 'low'. 288*cfb92d14SAndroid Build Coastguard Worker 289*cfb92d14SAndroid Build Coastguard Worker```bash 290*cfb92d14SAndroid Build Coastguard Worker> netdata publish prefix fd00:1234:5678::/64 paos med 291*cfb92d14SAndroid Build Coastguard WorkerDone 292*cfb92d14SAndroid Build Coastguard Worker``` 293*cfb92d14SAndroid Build Coastguard Worker 294*cfb92d14SAndroid Build Coastguard Worker### publish route \<prefix\> [sn][prf] 295*cfb92d14SAndroid Build Coastguard Worker 296*cfb92d14SAndroid Build Coastguard WorkerPublish an external route entry. 297*cfb92d14SAndroid Build Coastguard Worker 298*cfb92d14SAndroid Build Coastguard Worker- s: Stable flag 299*cfb92d14SAndroid Build Coastguard Worker- n: NAT64 flag 300*cfb92d14SAndroid Build Coastguard Worker- a: Advertising PIO (AP) flag 301*cfb92d14SAndroid Build Coastguard Worker- prf: Preference, which may be: 'high', 'med', or 'low'. 302*cfb92d14SAndroid Build Coastguard Worker 303*cfb92d14SAndroid Build Coastguard Worker```bash 304*cfb92d14SAndroid Build Coastguard Worker> netdata publish route fd00:1234:5678::/64 s high 305*cfb92d14SAndroid Build Coastguard WorkerDone 306*cfb92d14SAndroid Build Coastguard Worker``` 307*cfb92d14SAndroid Build Coastguard Worker 308*cfb92d14SAndroid Build Coastguard Worker### publish replace \<old prefix\> \<prefix\> [sn][prf] 309*cfb92d14SAndroid Build Coastguard Worker 310*cfb92d14SAndroid Build Coastguard WorkerReplace a previously published external route entry. 311*cfb92d14SAndroid Build Coastguard Worker 312*cfb92d14SAndroid Build Coastguard WorkerIf there is no previously published external route matching old prefix, this command behaves similarly to `netdata publish route`. If there is a previously published route entry, it will be replaced with the new prefix. In particular, if the old prefix was already added in the Network Data, the change to the new prefix is immediately reflected in the Network Data (i.e., old prefix is removed and the new prefix is added in the same Network Data registration request to leader). This ensures that route entries in the Network Data are not abruptly removed. 313*cfb92d14SAndroid Build Coastguard Worker 314*cfb92d14SAndroid Build Coastguard Worker- s: Stable flag 315*cfb92d14SAndroid Build Coastguard Worker- n: NAT64 flag 316*cfb92d14SAndroid Build Coastguard Worker- a: Advertising PIO (AP) flag 317*cfb92d14SAndroid Build Coastguard Worker- prf: Preference, which may be: 'high', 'med', or 'low'. 318*cfb92d14SAndroid Build Coastguard Worker 319*cfb92d14SAndroid Build Coastguard Worker```bash 320*cfb92d14SAndroid Build Coastguard Worker> netdata publish replace ::/0 fd00:1234:5678::/64 s high 321*cfb92d14SAndroid Build Coastguard WorkerDone 322*cfb92d14SAndroid Build Coastguard Worker``` 323*cfb92d14SAndroid Build Coastguard Worker 324*cfb92d14SAndroid Build Coastguard Worker### register 325*cfb92d14SAndroid Build Coastguard Worker 326*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata register` 327*cfb92d14SAndroid Build Coastguard Worker 328*cfb92d14SAndroid Build Coastguard WorkerRegister configured prefixes, routes, and services with the Leader. 329*cfb92d14SAndroid Build Coastguard Worker 330*cfb92d14SAndroid Build Coastguard Worker```bash 331*cfb92d14SAndroid Build Coastguard Worker> netdata register 332*cfb92d14SAndroid Build Coastguard WorkerDone 333*cfb92d14SAndroid Build Coastguard Worker``` 334*cfb92d14SAndroid Build Coastguard Worker 335*cfb92d14SAndroid Build Coastguard Worker### show 336*cfb92d14SAndroid Build Coastguard Worker 337*cfb92d14SAndroid Build Coastguard WorkerUsage: `netdata show [local] [-x] [\<rloc16\>]` 338*cfb92d14SAndroid Build Coastguard Worker 339*cfb92d14SAndroid Build Coastguard WorkerPrint entries in Network Data, on-mesh prefixes, external routes, services, and 6LoWPAN context information. 340*cfb92d14SAndroid Build Coastguard Worker 341*cfb92d14SAndroid Build Coastguard WorkerIf the optional `rloc16` input is specified, prints the entries associated with the given RLOC16 only. The RLOC16 filtering can be used when `-x` or `local` are not used. 342*cfb92d14SAndroid Build Coastguard Worker 343*cfb92d14SAndroid Build Coastguard WorkerOn-mesh prefixes are listed under `Prefixes` header: 344*cfb92d14SAndroid Build Coastguard Worker 345*cfb92d14SAndroid Build Coastguard Worker- The on-mesh prefix 346*cfb92d14SAndroid Build Coastguard Worker- Flags 347*cfb92d14SAndroid Build Coastguard Worker - p: Preferred flag 348*cfb92d14SAndroid Build Coastguard Worker - a: Stateless IPv6 Address Autoconfiguration flag 349*cfb92d14SAndroid Build Coastguard Worker - d: DHCPv6 IPv6 Address Configuration flag 350*cfb92d14SAndroid Build Coastguard Worker - c: DHCPv6 Other Configuration flag 351*cfb92d14SAndroid Build Coastguard Worker - r: Default Route flag 352*cfb92d14SAndroid Build Coastguard Worker - o: On Mesh flag 353*cfb92d14SAndroid Build Coastguard Worker - s: Stable flag 354*cfb92d14SAndroid Build Coastguard Worker - n: Nd Dns flag 355*cfb92d14SAndroid Build Coastguard Worker - D: Domain Prefix flag (only available for Thread 1.2). 356*cfb92d14SAndroid Build Coastguard Worker- Preference `high`, `med`, or `low` 357*cfb92d14SAndroid Build Coastguard Worker- RLOC16 of device which added the on-mesh prefix 358*cfb92d14SAndroid Build Coastguard Worker 359*cfb92d14SAndroid Build Coastguard WorkerExternal Routes are listed under `Routes` header: 360*cfb92d14SAndroid Build Coastguard Worker 361*cfb92d14SAndroid Build Coastguard Worker- The route prefix 362*cfb92d14SAndroid Build Coastguard Worker- Flags 363*cfb92d14SAndroid Build Coastguard Worker - s: Stable flag 364*cfb92d14SAndroid Build Coastguard Worker - n: NAT64 flag 365*cfb92d14SAndroid Build Coastguard Worker - a: Advertising PIO (AP) flag 366*cfb92d14SAndroid Build Coastguard Worker- Preference `high`, `med`, or `low` 367*cfb92d14SAndroid Build Coastguard Worker- RLOC16 of device which added the route prefix 368*cfb92d14SAndroid Build Coastguard Worker 369*cfb92d14SAndroid Build Coastguard WorkerService entries are listed under `Services` header: 370*cfb92d14SAndroid Build Coastguard Worker 371*cfb92d14SAndroid Build Coastguard Worker- Enterprise number 372*cfb92d14SAndroid Build Coastguard Worker- Service data (as hex bytes) 373*cfb92d14SAndroid Build Coastguard Worker- Server data (as hex bytes) 374*cfb92d14SAndroid Build Coastguard Worker- Flags 375*cfb92d14SAndroid Build Coastguard Worker - s: Stable flag 376*cfb92d14SAndroid Build Coastguard Worker- RLOC16 of devices which added the service entry 377*cfb92d14SAndroid Build Coastguard Worker- Service ID 378*cfb92d14SAndroid Build Coastguard Worker 379*cfb92d14SAndroid Build Coastguard Worker6LoWPAN Context IDs are listed under `Contexts` header: 380*cfb92d14SAndroid Build Coastguard Worker 381*cfb92d14SAndroid Build Coastguard Worker- The prefix 382*cfb92d14SAndroid Build Coastguard Worker- Context ID 383*cfb92d14SAndroid Build Coastguard Worker- Compress flag (`c` if marked or `-` otherwise). 384*cfb92d14SAndroid Build Coastguard Worker 385*cfb92d14SAndroid Build Coastguard WorkerCommissioning Dataset information is printed under `Commissioning` header: 386*cfb92d14SAndroid Build Coastguard Worker 387*cfb92d14SAndroid Build Coastguard Worker- Session ID if present in Dataset or `-` otherwise 388*cfb92d14SAndroid Build Coastguard Worker- Border Agent RLOC16 (in hex) if present in Dataset or `-` otherwise 389*cfb92d14SAndroid Build Coastguard Worker- Joiner UDP port number if present in Dataset or `-` otherwise 390*cfb92d14SAndroid Build Coastguard Worker- Steering Data (as hex bytes) if present in Dataset or `-` otherwise 391*cfb92d14SAndroid Build Coastguard Worker- Flags: 392*cfb92d14SAndroid Build Coastguard Worker - e: if Dataset contains any extra unknown TLV 393*cfb92d14SAndroid Build Coastguard Worker 394*cfb92d14SAndroid Build Coastguard WorkerPrint Network Data received from the Leader. 395*cfb92d14SAndroid Build Coastguard Worker 396*cfb92d14SAndroid Build Coastguard Worker```bash 397*cfb92d14SAndroid Build Coastguard Worker> netdata show 398*cfb92d14SAndroid Build Coastguard WorkerPrefixes: 399*cfb92d14SAndroid Build Coastguard Workerfd00:dead:beef:cafe::/64 paros med a000 400*cfb92d14SAndroid Build Coastguard WorkerRoutes: 401*cfb92d14SAndroid Build Coastguard Workerfd00:1234:0:0::/64 s med a000 402*cfb92d14SAndroid Build Coastguard Workerfd00:4567:0:0::/64 s med 8000 403*cfb92d14SAndroid Build Coastguard WorkerServices: 404*cfb92d14SAndroid Build Coastguard Worker44970 5d fddead00beef00007bad0069ce45948504d2 s a000 0 405*cfb92d14SAndroid Build Coastguard WorkerContexts: 406*cfb92d14SAndroid Build Coastguard Workerfd00:dead:beef:cafe::/64 1 c 407*cfb92d14SAndroid Build Coastguard WorkerCommissioning: 408*cfb92d14SAndroid Build Coastguard Worker1248 dc00 9988 00000000000120000000000000000000 e 409*cfb92d14SAndroid Build Coastguard WorkerDone 410*cfb92d14SAndroid Build Coastguard Worker``` 411*cfb92d14SAndroid Build Coastguard Worker 412*cfb92d14SAndroid Build Coastguard WorkerPrint Network Data entries from the Leader associated with `0xa00` RLOC16. 413*cfb92d14SAndroid Build Coastguard Worker 414*cfb92d14SAndroid Build Coastguard Worker```bash 415*cfb92d14SAndroid Build Coastguard Worker> netdata show 0xa00 416*cfb92d14SAndroid Build Coastguard WorkerPrefixes: 417*cfb92d14SAndroid Build Coastguard Workerfd00:dead:beef:cafe::/64 paros med a000 418*cfb92d14SAndroid Build Coastguard WorkerRoutes: 419*cfb92d14SAndroid Build Coastguard Workerfd00:1234:0:0::/64 s med a000 420*cfb92d14SAndroid Build Coastguard WorkerServices: 421*cfb92d14SAndroid Build Coastguard Worker44970 5d fddead00beef00007bad0069ce45948504d2 s a000 0 422*cfb92d14SAndroid Build Coastguard WorkerDone 423*cfb92d14SAndroid Build Coastguard Worker``` 424*cfb92d14SAndroid Build Coastguard Worker 425*cfb92d14SAndroid Build Coastguard WorkerPrint Network Data received from the Leader as hex-encoded TLVs. 426*cfb92d14SAndroid Build Coastguard Worker 427*cfb92d14SAndroid Build Coastguard Worker```bash 428*cfb92d14SAndroid Build Coastguard Worker> netdata show -x 429*cfb92d14SAndroid Build Coastguard Worker08040b02174703140040fd00deadbeefcafe0504dc00330007021140 430*cfb92d14SAndroid Build Coastguard WorkerDone 431*cfb92d14SAndroid Build Coastguard Worker``` 432*cfb92d14SAndroid Build Coastguard Worker 433*cfb92d14SAndroid Build Coastguard WorkerPrint local Network Data to sync with Leader. 434*cfb92d14SAndroid Build Coastguard Worker 435*cfb92d14SAndroid Build Coastguard Worker```bash 436*cfb92d14SAndroid Build Coastguard Worker> netdata show local 437*cfb92d14SAndroid Build Coastguard WorkerPrefixes: 438*cfb92d14SAndroid Build Coastguard Workerfd00:dead:beef:cafe::/64 paros med dc00 439*cfb92d14SAndroid Build Coastguard WorkerRoutes: 440*cfb92d14SAndroid Build Coastguard WorkerServices: 441*cfb92d14SAndroid Build Coastguard WorkerDone 442*cfb92d14SAndroid Build Coastguard Worker``` 443*cfb92d14SAndroid Build Coastguard Worker 444*cfb92d14SAndroid Build Coastguard WorkerPrint local Network Data to sync with Leader as hex-encoded TLVs. 445*cfb92d14SAndroid Build Coastguard Worker 446*cfb92d14SAndroid Build Coastguard Worker```bash 447*cfb92d14SAndroid Build Coastguard Worker> netdata show local -x 448*cfb92d14SAndroid Build Coastguard Worker08040b02174703140040fd00deadbeefcafe0504dc00330007021140 449*cfb92d14SAndroid Build Coastguard WorkerDone 450*cfb92d14SAndroid Build Coastguard Worker``` 451*cfb92d14SAndroid Build Coastguard Worker 452*cfb92d14SAndroid Build Coastguard Worker### netdata steeringdata check \<eui64\>|\<discerner\> 453*cfb92d14SAndroid Build Coastguard Worker 454*cfb92d14SAndroid Build Coastguard WorkerCheck whether the steering data includes a joiner. 455*cfb92d14SAndroid Build Coastguard Worker 456*cfb92d14SAndroid Build Coastguard Worker- eui64: The IEEE EUI-64 of the Joiner. 457*cfb92d14SAndroid Build Coastguard Worker- discerner: The Joiner discerner in format `number/length`. 458*cfb92d14SAndroid Build Coastguard Worker 459*cfb92d14SAndroid Build Coastguard Worker```bash 460*cfb92d14SAndroid Build Coastguard Worker> netdata steeringdata check d45e64fa83f81cf7 461*cfb92d14SAndroid Build Coastguard WorkerDone 462*cfb92d14SAndroid Build Coastguard Worker> netdata steeringdata check 0xabc/12 463*cfb92d14SAndroid Build Coastguard WorkerDone 464*cfb92d14SAndroid Build Coastguard Worker> netdata steeringdata check 0xdef/12 465*cfb92d14SAndroid Build Coastguard WorkerError 23: NotFound 466*cfb92d14SAndroid Build Coastguard Worker``` 467*cfb92d14SAndroid Build Coastguard Worker 468*cfb92d14SAndroid Build Coastguard Worker### unpublish 469*cfb92d14SAndroid Build Coastguard Worker 470*cfb92d14SAndroid Build Coastguard WorkerThis command unpublishes a previously published Network Data entry. 471*cfb92d14SAndroid Build Coastguard Worker 472*cfb92d14SAndroid Build Coastguard WorkerThis command requires `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE`. 473*cfb92d14SAndroid Build Coastguard Worker 474*cfb92d14SAndroid Build Coastguard Worker### unpublish dnssrp 475*cfb92d14SAndroid Build Coastguard Worker 476*cfb92d14SAndroid Build Coastguard WorkerUnpublishes DNS/SRP Service entry (available when `OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE` is enabled): 477*cfb92d14SAndroid Build Coastguard Worker 478*cfb92d14SAndroid Build Coastguard Worker- `netdata unpublish dnssrp` to unpublish "DNS/SRP Service" entry (anycast or unciast). 479*cfb92d14SAndroid Build Coastguard Worker 480*cfb92d14SAndroid Build Coastguard Worker```bash 481*cfb92d14SAndroid Build Coastguard Worker> netdata unpublish dnssrp 482*cfb92d14SAndroid Build Coastguard WorkerDone 483*cfb92d14SAndroid Build Coastguard Worker``` 484*cfb92d14SAndroid Build Coastguard Worker 485*cfb92d14SAndroid Build Coastguard Worker### unpublish \<prefix\> 486*cfb92d14SAndroid Build Coastguard Worker 487*cfb92d14SAndroid Build Coastguard WorkerUnpublishes a previously published on-mesh prefix or external route entry. 488*cfb92d14SAndroid Build Coastguard Worker 489*cfb92d14SAndroid Build Coastguard Worker```bash 490*cfb92d14SAndroid Build Coastguard Worker> netdata unpublish fd00:1234:5678::/64 491*cfb92d14SAndroid Build Coastguard WorkerDone 492*cfb92d14SAndroid Build Coastguard Worker``` 493