1# OpenThread CLI - SRP Server 2 3## Quick Start 4 5See [README_SRP.md](README_SRP.md). 6 7## Command List 8 9- [help](#help) 10- [addrmode](#addrmode) 11- [auto](#auto) 12- [disable](#disable) 13- [domain](#domain) 14- [enable](#enable) 15- [host](#host) 16- [lease](#lease) 17- [seqnum](#seqnum) 18- [service](#service) 19- [state](#state) 20 21## Command Details 22 23### help 24 25Usage: `srp server help` 26 27Print SRP server help menu. 28 29```bash 30> srp server help 31addrmode 32auto 33disable 34domain 35enable 36faststart 37help 38host 39lease 40seqnum 41service 42state 43Done 44``` 45 46### addrmode 47 48Usage: `srp server addrmode [unicast|anycast]` 49 50Get or set the address mode used by the SRP server. 51 52Address mode specifies how the address and port number are determined by the SRP server and this is published in the Thread Network Data. 53 54Get the address mode. 55 56```bash 57> srp server addrmode 58unicast 59Done 60``` 61 62Set the address mode. 63 64```bash 65> srp server addrmode anycast 66Done 67 68> srp server addrmode 69anycast 70Done 71``` 72 73### auto 74 75Usage: `srp server auto [enable|disable]` 76 77Enables or disables the auto-enable mode on the SRP server. 78 79When this mode is enabled, the Border Routing Manager controls if and when to enable or disable the SRP server. 80 81This command requires that `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` be enabled. 82 83```bash 84> srp server auto enable 85Done 86 87> srp server auto 88Enabled 89Done 90``` 91 92### disable 93 94Usage: `srp server disable` 95 96Disable the SRP server. 97 98```bash 99> srp server disable 100Done 101``` 102 103### domain 104 105Usage: `srp server domain [domain-name]` 106 107Get the domain. 108 109```bash 110> srp server domain 111default.service.arpa. 112Done 113``` 114 115Set the domain. 116 117```bash 118> srp server domain thread.service.arpa. 119Done 120``` 121 122### enable 123 124Usage: `srp server enable` 125 126Enable the SRP server. 127 128```bash 129> srp server enable 130Done 131``` 132 133### faststart 134 135Usage: `srp server faststart [enable]` 136 137This command requires that `OPENTHREAD_CONFIG_SRP_SERVER_FAST_START_MODE_ENABLE` be enabled. 138 139Enables the "Fast Start Mode" on the SRP server. 140 141The Fast Start Mode is designed for scenarios where a device, often a mobile device, needs to act as a provisional SRP server (e.g., functioning as a temporary Border Router). The SRP server function is enabled only if no other Border Routers (BRs) are already providing the SRP service within the Thread network. Importantly, Fast Start Mode allows the device to quickly start its SRP server functionality upon joining the network, allowing other Thread devices to quickly connect and register their services without the typical delays associated with standard Border Router initialization (and SRP server startup). 142 143The Fast Start Mode can be enabled when the device is in the detached or disabled state, the SRP server is currently disabled, and "auto-enable mode" is not in use. 144 145After successfully enabling Fast Start Mode, it can be disabled by a direct command to enable/disable the SRP server, using `srp server [enable/disable]`. 146 147```bash 148> srp server faststart enable 149Done 150 151> srp server faststart 152Enabled 153Done 154``` 155 156### host 157 158Usage: `srp server host` 159 160Print information of all registered hosts. 161 162```bash 163> srp server host 164srp-api-test-1.default.service.arpa. 165 deleted: false 166 addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 167srp-api-test-0.default.service.arpa. 168 deleted: false 169 addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 170Done 171``` 172 173### lease 174 175Usage: `srp server lease [<min-lease>] [<max-lease>] [<min-key-lease>] [<max-key-lease>]` 176 177Get LEASE and KEY-LEASE values. 178 179```bash 180> srp server lease 181min lease: 1800 182max lease: 7200 183min key-lease: 86400 184max key-lease: 1209600 185Done 186``` 187 188Set LEASE and KEY-LEASE values. 189 190```bash 191> srp server lease 1800 7200 86400 1209600 192Done 193``` 194 195### seqnum 196 197Usage: `srp server seqnum [<seqnum>]` 198 199Get or set the sequence number used with anycast address mode. 200 201The sequence number is included in "DNS/SRP Service Anycast Address" entry published in the Network Data. 202 203```bash 204> srp server seqnum 20 205Done 206 207> srp server seqnum 20820 209Done 210``` 211 212### service 213 214Usage: `srp server service` 215 216Print information of all registered services. 217 218The TXT record is displayed as an array of entries. If an entry has a key, the key will be printed in ASCII format. The value portion will always be printed as hex bytes. 219 220```bash 221> srp server service 222srp-api-test-1._ipps._tcp.default.service.arpa. 223 deleted: false 224 subtypes: (null) 225 port: 49152 226 priority: 0 227 weight: 0 228 ttl: 7200 229 lease: 7200 230 key-lease: 1209600 231 TXT: [616263, xyz=585960] 232 host: srp-api-test-1.default.service.arpa. 233 addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 234srp-api-test-0._ipps._tcp.default.service.arpa. 235 deleted: false 236 subtypes: _sub1,_sub2 237 port: 49152 238 priority: 0 239 weight: 0 240 ttl: 3600 241 lease: 3600 242 key-lease: 1209600 243 TXT: [616263, xyz=585960] 244 host: srp-api-test-0.default.service.arpa. 245 addresses: [fdde:ad00:beef:0:0:ff:fe00:fc10] 246Done 247``` 248 249### state 250 251Usage: `srp server state` 252 253Print the state of the SRP server. It could be `disabled`, `stopped` or `running`. 254 255- disabled: The SRP server is not enabled. 256- stopped: The SRP server is enabled but not active due to existing SRP servers already active in the Thread network. The SRP server may become active when existing SRP servers are no longer active within the Thread network. 257- running: The SRP server is active and will handle service registrations. 258 259```bash 260> srp server state 261running 262Done 263``` 264