TR-069
CLI reference:/tr069-client
The TR-069 client implements the CPE WAN Management Protocol (CWMP), standardized by the Broadband Forum (BBF). The router (the CPE) connects over HTTP or HTTPS to an Auto Configuration Server (ACS), which can read and change parameters, run RouterOS scripts, upgrade RouterOS, upload the configuration and the log, and reset the router. ISPs use it to manage customer routers; it also works for managing network infrastructure devices.
The client is in the tr069-client package, which is not part of the main RouterOS package.
Install it as described in Packages. The
client is disabled by default.
Connect the router to an ACS
This example connects a router with the default configuration to the ACS at
https://acs.example.com:7547/, whose address is 198.51.100.10. Before you start, upload the CA
certificate that signed the ACS certificate to the router as acs-ca.crt (see
Files for the ways to upload a file), and
create the device credentials on the ACS.
/certificate/import file-name=acs-ca.crt passphrase=""
/tr069-client/set acs-url=https://acs.example.com:7547/ \
username=cpe-0001 password=Cpe-0001- \
connection-request-username=acs \
connection-request-password=Acs-request- enabled=yes
/ip/firewall/filter/add chain=input action=accept protocol=tcp \
dst-port=7547 src-address=198.51.100.10 in-interface-list=WAN \
place-before=[find comment~"not coming from LAN"] \
comment="TR-069 connection requests from the ACS"
- The import deletes the file and adds the CA as a trusted certificate. With the default
check-certificate=yes, the router connects only if the ACS certificate is signed by a CA in the store and its name matches the host inacs-url. usernameandpasswordare the credentials the router uses to log in to the ACS.connection-request-usernameandconnection-request-passwordare the credentials the ACS uses to ask the router to start a session (a connection request). Always set them.- The firewall rule lets connection requests from the ACS reach the router. The client adds no
firewall rule itself, and the default configuration drops them with all other input from the
interfaces in the
WANlist. The rule is placed before the default ruledefconf: drop all not coming from LAN. Without the rule, the router still contacts the ACS on its own events and periodically, but the ACS cannot reach it in between.
Check the client:
/tr069-client/print
enabled: yes
acs-url: https://acs.example.com:7547/
username: cpe-0001
periodic-inform-enabled: yes
periodic-inform-interval: 1d
connection-request-username: acs
connection-request-port: 7547
provisioning-code:
client-certificate: none
check-certificate: yes
status: running
last-session-error:
retry-count: 0
An empty last-session-error with retry-count: 0 means the last session with the ACS
succeeded. The ACS now lists the router as a new device: its first Inform carries the
0 BOOTSTRAP event.
Use plain HTTP only to test a setup in a private network. Anyone on the path can read and change
the parameters of an HTTP session. In production, use HTTPS and keep check-certificate=yes.
Check and troubleshoot
status shows whether the client is configured: disabled, waiting-url (enabled, but no ACS
URL) or running. A failing ACS does not change it. Failures show in last-session-error and
retry-count. For example, with a password the ACS does not accept:
/tr069-client/print
enabled: yes
acs-url: https://acs.example.com:7547/
username: cpe-0001
periodic-inform-enabled: yes
periodic-inform-interval: 1d
connection-request-username: acs
connection-request-port: 7547
provisioning-code:
client-certificate: none
check-certificate: yes
status: running
last-session-error: HTTP authentication error. Wrong username/password.
retry-count: 3
The client retries a failed session with a growing delay, from a few seconds up to minutes, and
resets retry-count after the next successful session. A corrected setting is used at the next
retry.
To follow each session, log the tr069 topic:
/system/logging/add topics=tr069
/log/print where topics~"tr069"
2026-11-23 08:16:36 tr069,debug starting session, events: [4 VALUE CHANGE, 1 BOOT, ]
2026-11-23 08:16:36 tr069,debug session finished with error: "Network unreachable"
2026-11-23 08:16:36 tr069,debug scheduled next Session retry after 7 seconds
2026-11-23 08:16:43 tr069,debug starting session, events: [4 VALUE CHANGE, 1 BOOT, ] retry-count: 1
2026-11-23 08:16:43 tr069,debug send: Inform
2026-11-23 08:16:43 tr069,debug session finished with error: "HTTP authentication error. Wrong username/password."
2026-11-23 08:16:44 tr069,debug scheduled next Session retry after 18 seconds
2026-11-23 08:17:02 tr069,debug starting session, events: [4 VALUE CHANGE, 1 BOOT, ] retry-count: 2
2026-11-23 08:17:02 tr069,debug send: Inform
2026-11-23 08:17:02 tr069,debug session finished with error: "HTTP authentication error. Wrong username/password."
2026-11-23 08:17:02 tr069,debug scheduled next Session retry after 31 seconds
Here the first session after a reboot started before the DHCP client had an address, and the
following ones were refused by the ACS. A successful session ends with session finished ok and
scheduled next Periodic Inform.
Common errors in last-session-error:
| Error | Cause |
|---|---|
HTTP authentication error. Wrong username/password. | The ACS refused username and password. |
SSL: ssl: no trusted CA certificate found (6) | The CA that signed the ACS certificate is not in the certificate store. |
SSL: ssl: name verification failed for: "CN=..." (6) | The ACS certificate is for another name than the host in acs-url. |
resolving error | The router cannot resolve the host name in acs-url. Check /ip/dns. |
Connection refused | Nothing listens on the host and port in acs-url. |
Network unreachable | The router has no route to the ACS yet, for example right after boot. |
HTTP error code: 500 | The ACS answered with an HTTP error. Check the ACS logs. |
If the ACS cannot reach the router with a connection request, check the firewall rule from the example and its counters, and the connection request credentials on the ACS.
How a session works
The router starts every session. It sends an Inform RPC that lists the events that caused the session, the device identity and a few parameters. When the router has nothing more to send, the ACS calls its RPCs: reading and setting parameters, downloads, uploads, reboot or factory reset.
| Event in the Inform | When |
|---|---|
0 BOOTSTRAP | First session with an ACS: after the client is enabled for the first time, after acs-url changes, and after a configuration reset. |
1 BOOT | After a reboot, and when the client is enabled. |
2 PERIODIC | Every periodic-inform-interval (default one day), if periodic-inform-enabled=yes. |
4 VALUE CHANGE | A client setting changed since the last session. |
6 CONNECTION REQUEST | After a connection request from the ACS. |
7 TRANSFER COMPLETE with M Download or M Upload | After a download or upload the ACS asked for, with the result. |
M Reboot | After a reboot the ACS asked for. |
The Inform identifies the router with Manufacturer MikroTik, an OUI, a ProductClass and a
SerialNumber. It also carries the RouterOS version
(Device.DeviceInfo.SoftwareVersion), provisioning-code (Device.DeviceInfo.ProvisioningCode)
and the connection request URL (Device.ManagementServer.ConnectionRequestURL).
A connection request is an HTTP request from the ACS to that URL,
https://<router address>:<connection-request-port>/<random path>, where the address is the
router's own address. The ACS must be able to open a TCP connection to it, so a router behind NAT
receives connection requests only if the NAT device forwards the port. The router accepts the
request only with HTTP Digest authentication and the connection-request-username and
connection-request-password. It then starts a new session with the configured ACS. A connection
request cannot make the router contact any other server.
Parameters and data models
Parameters are name and value pairs, such as Device.DeviceInfo.SoftwareVersion. The set of
parameters a device supports is its data model. The BBF defines the root data models TR-098 and
TR-181 (Issue 1 and Issue 2), on which vendors base their parameters. The RouterOS data model is
based on TR-181 Issue 2: the router reports Device.RootDataModelVersion 2.15. MikroTik-specific
parameters start with X_MIKROTIK_, for example Device.DeviceInfo.X_MIKROTIK_SystemIdentity.
Some parameters map to RouterOS settings. For example, setting
Device.DeviceInfo.X_MIKROTIK_SystemIdentity changes /system/identity, and setting
Device.ManagementServer.PeriodicInformInterval to 300 sets periodic-inform-interval=5m.
See the RouterOS TR-069 parameter reference for all supported parameters.
Change the configuration
Not every RouterOS setting has a CWMP parameter. To change any setting, the ACS sends a RouterOS
script with the Download RPC and FileType 3 Vendor Configuration File. The URL's file name decides
what the router does with it. Put the file on an HTTP or HTTPS server that the router can reach,
for example the file server of the ACS:
- A file name ending in
.alterchanges the configuration: the router runs the script as it is, without a reboot, and reports the result with TransferComplete. - Any other file name replaces the configuration: the router removes the whole configuration,
reboots and applies the file. The next session starts with
0 BOOTSTRAPand1 BOOT.
For example, a file named identity-dns.alter with this content renames the router and sets its
DNS server:
/system/identity/set name=CPE-altered
/ip/dns/set servers=192.0.2.53
A file that replaces the configuration must bring the router back to the ACS on its own. The rest of the file is not applied after a line that fails, so a single error can leave the router without the TR-069 client and out of reach of the ACS. Test each file on a local router first. Things to include:
- A startup delay, so that the interfaces exist before the script configures them.
- Passwords: an exported configuration, including the file the router sends with the Upload RPC, does not contain them, including the TR-069 client password. Such a file cannot replace the configuration unchanged.
- Certificates that the configuration needs, such as the CA certificate of the ACS.
Upgrade RouterOS
The CWMP standard upgrades firmware with the Download RPC, FileType 1 Firmware Upgrade Image and
a single URL (HTTP or HTTPS). RouterOS is installed as packages, so the URL points to an XML file
that lists the package files to install, for an upgrade or a downgrade. The router downloads the
XML, checks it, downloads every listed file and installs them as in an upgrade by package file
upload, then reboots. It reports the result with TransferComplete in the first session after the
reboot (events 7 TRANSFER COMPLETE, M Download and 1 BOOT).
Put the XML file and the packages on an HTTP or HTTPS server that the router can reach, and send the
Download RPC with the URL of the XML file, for example https://example.com/path/upgrade.xml. List
the tr069-client package together with the RouterOS package, so that the client is upgraded with
it. The packages must match the router's architecture, which the router reports in
Device.DeviceInfo.X_MIKROTIK_ArchName:
<upgrade version="1" type="links">
<config/>
<links>
<link>
<url>https://example.com/routeros-X.Y.Z-mipsbe.npk</url>
</link>
<link>
<url>https://example.com/tr069-client-X.Y.Z-mipsbe.npk</url>
</link>
</links>
</upgrade>
If the download fails, the router reports a fault in TransferComplete, for example 9015 with
Connection refused.
Upgrade step by step: first upgrade a router you have tested locally, and check that it reconnects to the ACS and that the functions you need work. Then upgrade groups of routers. Do not upgrade all remote routers at once. Serve the files over HTTPS in production.
Upload files to the ACS
With the Upload RPC, the router sends a file to the URL the ACS gives, with HTTP PUT, and reports the result with TransferComplete. The FileType selects the file:
1 Vendor Configuration File: the current configuration, as/exportshows it. Passwords and other sensitive values are not included.2 Vendor Log File: the log, similar to/log/print: one line per entry with the time (in ISO 8601 format), topics and message.X MIKROTIK Factory Configuration File: the default configuration script that runs at the next configuration reset. If a custom script is installed, this is the custom script, which differs from the one/system/default-configuration/printshows.
Reset the router to its default configuration
The FactoryReset RPC resets the configuration in the same way as this command:
/system/reset-configuration skip-backup=yes
The reset removes the whole configuration, including certificates, and runs the default configuration script. The default configuration differs between devices (see Default configurations). To bring routers back to the ACS after a reset, install a custom default configuration that configures the TR-069 client, as the next section describes.
Prepare routers for TR-069 management
A provider who manages routers over TR-069 can replace MikroTik's default configuration with a
custom script that brings the router back to the ACS after a reset: a FactoryReset RPC,
/system/reset-configuration or the reset button. This makes a router reachable again after a
configuration that cannot be fixed remotely.
The custom default configuration script can be installed in two ways:
- With Netinstall, which installs the script in place of MikroTik's default configuration.
- With the Download RPC and FileType
X MIKROTIK Factory Configuration File. The router stores the script without a reboot and without changing the current configuration.
After a Download of the script, /system/default-configuration/print keeps showing MikroTik's
script. The custom script shows in
/system/default-configuration/custom-script/print, and /export starts with the comment
# custom default configuration script installed.
The script runs on a router with an empty configuration and no certificates. If it fails, the router can end up unreachable for the ACS. Test it with a reset on a local router first.
At minimum, the script imports the CA certificate of the ACS, configures IP connectivity, a firewall and the TR-069 client. The ACS configures the rest.
Example default configuration script
This script assumes that ether1 is the WAN port, that the router gets its address from a DHCP
client, and that the ACS at 198.51.100.10 uses a certificate signed by the CA in the script. The
certificate in the script is a placeholder: replace it with your CA certificate, and replace the
address, acs-url and the credentials. Add your own configuration.
The router waits for the Ethernet interfaces to appear, imports the CA certificate, adds a firewall
that accepts only connection requests from the ACS on ether1, turns off MAC server access, and
enables the TR-069 client.
# Default configuration of a router managed over TR-069
:local acsCaCert "-----BEGIN CERTIFICATE-----
MIIDCDCCAfCgAwIBAgIIBQ68Phid9+owDQYJKoZIhvcNAQELBQAwDzENMAsGA1UE
AwwEbXlDYTAeFw03MDAxMDIwMDM0MDZaFw03MTAxMDIwMDM0MDZaMA8xDTALBgNV
BAMMBG15Q2EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDILvvnEc/8
53jevX3MW4qjn9CNdHLexUZSL8qSXzE5sik1kaNOdckOXC8/Ku0qO95elaBaXmLe
QsIQbVtZ768SBQc7q4RaG3AEauLfNl0BS3kl91/nSvYKp20Nvn7LP7CVZj8D81S+
z4lYgab00X6hT65r8cOI4idaJNWkB9+vFujiPpg0H4IEthgslvCu0i2C7VMrZps/
lTI4xD7kUU4ySzpMUDD3SiA1cEtR8SC5gspYFqtUB2Chk4DTeqWzPCT9eIKclIKM
eh/5w7eLCKyjqIBDwWixuHGW7uFffHjmkgtmzG35W/qmgXGXG+BC8NomxmKxdxCT
ZpQCbisMKieTAgMBAAGjaDBmMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD
AgEGMB0GA1UdDgQWBBR5poVfi8tXHrD3sEidlLLzm1k3xzAkBglghkgBhvhCAQ0E
FxYVR2VuZXJhdGVkIGJ5IFJvdXRlck9TMA0GCSqGSIb3DQEBCwUAA4IBAQChVt7s
YNL+U7p0OoxdKgCqP3JyrVOAYDs51243IR83BM3WQybWaDcEv50/R668icnnNHgN
GKQ6OjgQbia7ZW38JWlD/n59WDjk9T63lHh5RHmrhPlIDUN8Wh89v6N2q8YQy+rj
o2lOcbZOJTSIirSBcokMRw45yJNO9HU02E9Bl5nb1hq6/xP4pbTS3t8bL+Xpg0eJ
herz/Ap62k/ToRP+yFYN90z8sDHHvKWnq1W60xreLQ95D5IOego0dIWDC8J/a551
Z2AklvEhKfJTQ6zylrhPDy5bySadxy8lAV82+gEZ1AQyS2UXzRAUgCCCzdEmgiWE
6Du6ubASPAEmYfhC
-----END CERTIFICATE-----"
# Wait up to 30 seconds for the Ethernet interfaces to appear
:local count 0
:while ([:len [/interface/ethernet/find]] = 0 && $count < 30) do={
:delay 1s
:set count ($count + 1)
}
# Import the CA certificate that signed the ACS certificate
/file/add name=acs-ca.crt contents=$acsCaCert
/certificate/import file-name=acs-ca.crt passphrase=""
# Firewall: allow connection requests from the ACS only
/ip/firewall/filter/add chain=input action=accept \
connection-state=established,related \
comment="defconf: accept established,related"
/ip/firewall/filter/add chain=input action=accept protocol=tcp \
dst-port=7547 src-address=198.51.100.10 in-interface=ether1 \
comment="defconf: accept TR-069 connection requests"
/ip/firewall/filter/add chain=input action=drop in-interface=ether1 \
comment="defconf: drop all from WAN"
/ip/neighbor/discovery-settings/set discover-interface-list=none
# No MAC server access, IPv6 input from ether1 dropped
/tool/mac-server/set allowed-interface-list=none
/tool/mac-server/mac-winbox/set allowed-interface-list=none
/ipv6/firewall/filter/add chain=input action=accept \
connection-state=established,related \
comment="defconf: accept established,related"
/ipv6/firewall/filter/add chain=input action=accept protocol=icmpv6 \
comment="defconf: accept ICMPv6"
/ipv6/firewall/filter/add chain=input action=drop in-interface=ether1 \
comment="defconf: drop all from WAN"
# Get an address on ether1 and connect to the ACS
:if ([:len [/ip/dhcp-client/find interface=ether1]] = 0) do={
/ip/dhcp-client/add interface=ether1 comment="defconf"
}
/tr069-client/set enabled=yes acs-url="https://acs.example.com:7547/" \
username=cpe-0001 password=Cpe-0001- \
connection-request-username=acs \
connection-request-password=Acs-request-
After a reset with this script, the router has no LAN configuration and accepts no management
access from ether1. Neighbor discovery is off on all interfaces; to use it on the LAN side, define
an interface list for it. Configure the rest, including the LAN, from the ACS, for example with
.alter files.
Tested ACSs
Ordering is alphabetical. MikroTik does not imply any one vendor's superiority over another.
Commercial
MikroTik has tested and verified the following commercial ACS solutions:
Open source
For all /tr069-client properties, see the CLI reference.