1# OpenThread CLI - Border Router (BR) 2 3## Command List 4 5Usage : `br [command] ...` 6 7- [counters](#counters) 8- [disable](#disable) 9- [enable](#enable) 10- [help](#help) 11- [init](#init) 12- [nat64prefix](#nat64prefix) 13- [omrprefix](#omrprefix) 14- [onlinkprefix](#onlinkprefix) 15- [pd](#pd) 16- [peers](#peers) 17- [prefixtable](#prefixtable) 18- [rioprf](#rioprf) 19- [routeprf](#routeprf) 20- [routers](#routers) 21- [state](#state) 22 23## Command Details 24 25### help 26 27Usage: `br help` 28 29Print BR command help menu. 30 31```bash 32> br help 33counters 34disable 35enable 36omrprefix 37onlinkprefix 38pd 39peers 40prefixtable 41raoptions 42rioprf 43routeprf 44routers 45state 46Done 47``` 48 49### init 50 51Usage: `br init <interface> <enabled>` 52 53Initializes the Border Routing Manager on given infrastructure interface. 54 55```bash 56> br init 2 1 57Done 58``` 59 60### enable 61 62Usage: `br enable` 63 64Enable the Border Routing functionality. 65 66```bash 67> br enable 68Done 69``` 70 71### disable 72 73Usage: `br disable` 74 75Disable the Border Routing functionality. 76 77```bash 78> br disable 79Done 80``` 81 82### state 83 84Usage: `br state` 85 86Get the Border Routing state: 87 88- `uninitialized`: Routing Manager is uninitialized. 89- `disabled`: Routing Manager is initialized but disabled. 90- `stopped`: Routing Manager in initialized and enabled but currently stopped. 91- `running`: Routing Manager is initialized, enabled, and running. 92 93```bash 94> br state 95running 96``` 97 98### counters 99 100Usage : `br counters` 101 102Get the Border Router counter. 103 104```bash 105> br counters 106Inbound Unicast: Packets 4 Bytes 320 107Inbound Multicast: Packets 0 Bytes 0 108Outbound Unicast: Packets 2 Bytes 160 109Outbound Multicast: Packets 0 Bytes 0 110RA Rx: 4 111RA TxSuccess: 2 112RA TxFailed: 0 113RS Rx: 0 114RS TxSuccess: 2 115RS TxFailed: 0 116Done 117``` 118 119### omrprefix 120 121Usage: `br omrprefix [local|favored]` 122 123Get local or favored or both off-mesh-routable prefixes of the Border Router. 124 125```bash 126> br omrprefix 127Local: fdfc:1ff5:1512:5622::/64 128Favored: fdfc:1ff5:1512:5622::/64 prf:low 129Done 130 131> br omrprefix favored 132fdfc:1ff5:1512:5622::/64 prf:low 133Done 134 135> br omrprefix local 136fdfc:1ff5:1512:5622::/64 137Done 138``` 139 140### onlinkprefix 141 142Usage: `br onlinkprefix [local|favored]` 143 144Get local or favored or both on-link prefixes of the Border Router. 145 146```bash 147> br onlinkprefix 148Local: fd41:2650:a6f5:0::/64 149Favored: 2600::0:1234:da12::/64 150Done 151 152> br onlinkprefix favored 1532600::0:1234:da12::/64 154Done 155 156> br onlinkprefix local 157fd41:2650:a6f5:0::/64 158Done 159``` 160 161### nat64prefix 162 163Usage: `br nat64prefix [local|favored]` 164 165Get local or favored or both NAT64 prefixes of the Border Router. 166 167`OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` is required. 168 169```bash 170> br nat64prefix 171Local: fd14:1078:b3d5:b0b0:0:0::/96 172Favored: fd14:1078:b3d5:b0b0:0:0::/96 prf:low 173Done 174 175> br nat64prefix favored 176fd14:1078:b3d5:b0b0:0:0::/96 prf:low 177Done 178 179> br nat64prefix 180fd14:1078:b3d5:b0b0:0:0::/96 181Done 182``` 183 184### pd 185 186Usage: `br pd [enable|disable]` 187 188Enable/Disable the DHCPv6 PD. 189 190```bash 191> br pd enable 192Done 193 194> br pd disable 195Done 196``` 197 198Usage: `br pd state` 199 200Get the state of DHCPv6 PD. 201 202`OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE` is required. 203 204- `disabled`: DHCPv6 PD is disabled on the border router. 205- `stopped`: DHCPv6 PD in enabled but won't try to request and publish a prefix. 206- `running`: DHCPv6 PD is enabled and will try to request and publish a prefix. 207 208```bash 209> br pd state 210running 211Done 212``` 213 214Usage `br pd omrprefix` 215 216Get the DHCPv6 Prefix Delegation (PD) provided off-mesh-routable (OMR) prefix. 217 218`OPENTHREAD_CONFIG_BORDER_ROUTING_DHCP6_PD_ENABLE` is required. 219 220```bash 221> br pd omrprefix 2222001:db8:cafe:0:0/64 lifetime:1800 preferred:1800 223Done 224``` 225 226### peers 227 228Usage: `br peers` 229 230Get the list of peer BRs found in the Network Data. 231 232`OPENTHREAD_CONFIG_BORDER_ROUTING_TRACK_PEER_BR_INFO_ENABLE` is required. 233 234Peer BRs are other devices within the Thread mesh that provide external IP connectivity. A device is considered to provide external IP connectivity if at least one of the following conditions is met regarding its Network Data entries: 235 236- It has added at least one external route entry. 237- It has added at least one prefix entry with both the default-route and on-mesh flags set. 238- It has added at least one domain prefix (with both the domain and on-mesh flags set). 239 240The list of peer BRs specifically excludes the current device, even if it is itself acting as a BR. 241 242Info per BR entry: 243 244- RLOC16 of the BR 245- Age as the duration interval since this BR appeared in Network Data. It is formatted as `{hh}:{mm}:{ss}` for hours, minutes, seconds, if the duration is less than 24 hours. If the duration is 24 hours or more, the format is `{dd}d.{hh}:{mm}:{ss}` for days, hours, minutes, seconds. 246 247```bash 248> br peers 249rloc16:0x5c00 age:00:00:49 250rloc16:0xf800 age:00:01:51 251Done 252``` 253 254Usage: `br peers count` 255 256Gets the number of peer BRs found in the Network Data. 257 258The count does not include the current device, even if it is itself acting as a BR. 259 260The output indicates the minimum age among all peer BRs. Age is formatted as `{hh}:{mm}:{ss}` for hours, minutes, seconds, if the duration is less than 24 hours. If the duration is 24 hours or more, the format is `{dd}d.{hh}:{mm}:{ss}` for days, hours, minutes, seconds. 261 262```bash 263> br peer count 2642 min-age:00:00:49 265Done 266``` 267 268### prefixtable 269 270Usage: `br prefixtable` 271 272Get the discovered prefixes by Border Routing Manager on the infrastructure link. 273 274Info per prefix entry: 275 276- The prefix 277- Whether the prefix is on-link or route 278- Milliseconds since last received Router Advertisement containing this prefix 279- Prefix lifetime in seconds 280- Preferred lifetime in seconds only if prefix is on-link 281- Route preference (low, med, high) only if prefix is route (not on-link) 282- The router IPv6 address which advertising this prefix 283- Flags in received Router Advertisement header: 284 - M: Managed Address Config flag 285 - O: Other Config flag 286 - Stub: Stub Router flag (indicates whether the router is a stub router) 287 288```bash 289> br prefixtable 290prefix: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 (M:0 O:0 Stub:1) 291prefix: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 (M:0 O:0 Stub:1) 292Done 293``` 294 295### raoptions 296 297Usage: `br raoptions <options>` 298 299Sets additional options to append at the end of emitted Router Advertisement (RA) messages. `<options>` provided as hex bytes. 300 301```bash 302> br raoptions 0400ff00020001 303Done 304``` 305 306### raoptions clear 307 308Usage: `br raoptions clear` 309 310Clear any previously set additional options to append at the end of emitted Router Advertisement (RA) messages. 311 312```bash 313> br raoptions clear 314Done 315``` 316 317### rioprf 318 319Usage: `br rioprf` 320 321Get the preference used when advertising Route Info Options (e.g., for discovered OMR prefixes) in emitted Router Advertisement message. 322 323```bash 324> br rioprf 325med 326Done 327``` 328 329### rioprf \<prf\> 330 331Usage: `br rioprf high|med|low` 332 333Set the preference (which may be 'high', 'med', or 'low') to use when advertising Route Info Options (e.g., for discovered OMR prefixes) in emitted Router Advertisement message. 334 335```bash 336> br rioprf low 337Done 338``` 339 340### rioprf clear 341 342Usage: `br rioprf clear` 343 344Clear a previously set preference value for advertising Route Info Options (e.g., for discovered OMR prefixes) in emitted Router Advertisement message. When cleared BR will use device's role to determine the RIO preference: Medium preference when in router/leader role and low preference when in child role. 345 346```bash 347> br rioprf clear 348Done 349``` 350 351### routeprf 352 353Usage: `br routeprf` 354 355Get the preference used for publishing routes in Thread Network Data. This may be the automatically determined route preference, or an administratively set fixed route preference - if applicable. 356 357```bash 358> br routeprf 359med 360Done 361``` 362 363### routeprf \<prf\> 364 365Usage: `br routeprf high|med|low` 366 367Set the preference (which may be 'high', 'med', or 'low') to use publishing routes in Thread Network Data. Setting a preference value overrides the automatic route preference determination. It is used only for an explicit administrative configuration of a Border Router. 368 369```bash 370> br routeprf low 371Done 372``` 373 374### routeprf clear 375 376Usage: `br routeprf clear` 377 378Clear a previously set preference value for publishing routes in Thread Network Data. When cleared BR will automatically determine the route preference based on device's role and link quality to parent (when acting as end-device). 379 380```bash 381> br routeprf clear 382Done 383``` 384 385### routers 386 387Usage: `br routers` 388 389Get the list of discovered routers by Border Routing Manager on the infrastructure link. 390 391Info per router: 392 393- The router IPv6 address 394- Flags in received Router Advertisement header: 395 - M: Managed Address Config flag 396 - O: Other Config flag 397 - Stub: Stub Router flag (indicates whether the router is a stub router) 398- Milliseconds since last received message from this router 399- Reachability flag: A router is marked as unreachable if it fails to respond to multiple Neighbor Solicitation probes. 400- Age: Duration interval since this router was first discovered. It is formatted as `{hh}:{mm}:{ss}` for hours, minutes, seconds, if the duration is less than 24 hours. If the duration is 24 hours or more, the format is `{dd}d.{hh}:{mm}:{ss}` for days, hours, minutes, seconds. 401- `(this BR)` is appended when the router is the local device itself. 402- `(peer BR)` is appended when the router is likely a peer BR connected to the same Thread mesh. This requires `OPENTHREAD_CONFIG_BORDER_ROUTING_TRACK_PEER_BR_INFO_ENABLE`. 403 404```bash 405> br routers 406ff02:0:0:0:0:0:0:1 (M:0 O:0 Stub:1) ms-since-rx:1505 reachable:yes age:00:18:13 407Done 408``` 409