# Testing intent-based RouterOS automation with the official CHR image in Containerlab

**URL:** <https://forum.mikrotik.com/t/testing-intent-based-routeros-automation-with-the-official-chr-image-in-containerlab/274488>\
**Category:** RouterOS\
**Created:** [November 13, 2026, 1:31pm UTC](https://forum.mikrotik.com/t/testing-intent-based-routeros-automation-with-the-official-chr-image-in-containerlab/274488 "2026-11-13T13:31:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mischa01101](https://forum.mikrotik.com/letter_avatar/mischa01101/32/6_449c533f586939b6e5f246632a46421f.png) [@mischa01101](https://forum.mikrotik.com/u/mischa01101)\
**Post date:** [November 13, 2026, 1:31pm UTC](https://forum.mikrotik.com/t/testing-intent-based-routeros-automation-with-the-official-chr-image-in-containerlab/274488/1 "2026-11-13T13:31:05Z")

</div>

We built a fully centralized, intent-based automation system for MikroTik networks with Ansible. The intended state of each network is defined in one place, and Ansible applies it to every router. Before a change reaches a router, it runs against a copy of the network in Containerlab.

Containerlab 0.82.0 made these labs simpler to build. Its new `mikrotik_chr` kind runs MikroTik's official `mikrotik/chr` image from Docker Hub as published, on amd64 and arm64. There is no vrnetlab build anymore, and Containerlab pulls the image on the first deploy. In the test runs in the pull request, a router was ready after about a minute, with or without KVM. Each router gets about 256 MiB of memory by default, so we can build fairly large MikroTik networks to test against.

[https://containerlab.dev/manual/kinds/mikrotik\_chr/](https://containerlab.dev/manual/kinds/mikrotik_chr/)

- [Release notes for Containerlab 0.82](https://containerlab.dev/rn/0.82/)
- [The mikrotik/chr image on Docker Hub](https://hub.docker.com/r/mikrotik/chr)
- [Pull request with the test runs on amd64 and arm64](https://github.com/srl-labs/containerlab/pull/3498)
- [Earlier thread in this forum asking for these images](https://forum.mikrotik.com/t/real-docker-images-for-chr-to-run-in-containerlalb/181934)

Thanks to MikroTik for publishing amd64 and arm64 images.

### A small lab

Save this as `mikrotik.clab.yml`:

```yaml
name: mikrotik
topology:
  kinds:
    mikrotik_chr:
      image: mikrotik/chr:7.24.5
  nodes:
    r1:
      kind: mikrotik_chr
    r2:
      kind: mikrotik_chr
    r3:
      kind: mikrotik_chr
  links:
    - endpoints: ["r1:ether2", "r2:ether2"]
    - endpoints: ["r2:ether3", "r3:ether2"]
    - endpoints: ["r3:ether3", "r1:ether3"]

```

Start the lab, log in to r1 and remove the lab again:

```bash
sudo containerlab deploy -t mikrotik.clab.yml
ssh admin@clab-mikrotik-r1
sudo containerlab destroy -t mikrotik.clab.yml

```

The default login is admin with the password admin. `ether1` is the management port in its own VRF, so data links start at `ether2`. SSH, the API and REST answer on the management address, so Ansible reaches the lab routers the same way it reaches real ones. Labs on the older `mikrotik_ros` kind move over by changing `kind` and `image`.

### How we use it

Our initial work is open source as [ansible-mikrotik](https://github.com/narrowin/ansible-mikrotik). It lags a bit behind what we use today. Our [Containerlab guide](https://narrowin.com/en/work-containerlab) shows how we build and use these labs. We use the same approach for [OT WANs](https://narrowin.com/en/ot-connect), [campus networks](https://narrowin.com/en/research) and data center fabrics such as the one at [sciCORE](https://narrowin.com/en/work-scicore), University of Basel.

[https://narrowin.com/mikrotik](https://narrowin.com/mikrotik)
