MikroTik Configuration
Settings for the MikroTik RouterOS API connection.
Connection
Section titled “Connection”mikrotik.address Required
Section titled “mikrotik.address ”Env: MIKROTIK_HOST · Default: — (required)
RouterOS API address in host:port format. There is no built-in default: the bouncer exits with mikrotik.address is required if this value is empty. The 192.168.0.1:8728 used below is the sample value shipped in config/cs-routeros-bouncer.yaml, not a default.
- Port
8728— plaintext API - Port
8729— TLS-encrypted API
mikrotik: address: "192.168.0.1:8728"mikrotik.username Required
Section titled “mikrotik.username ”Env: MIKROTIK_USER · Default: — (required)
The RouterOS API username. There is no built-in default: the bouncer exits with mikrotik.username is required if this value is empty. The crowdsec name is the sample value shipped in config/cs-routeros-bouncer.yaml, not a default. Use a dedicated user with minimal permissions. See Router Setup for creating the user.
mikrotik.password Required
Section titled “mikrotik.password ”Env: MIKROTIK_PASS · Default: — (required)
The RouterOS API password.
mikrotik.tls Optional
Section titled “mikrotik.tls ”Env: MIKROTIK_TLS · Default: false
Enable TLS for the RouterOS API connection. Requires the api-ssl service on the router (port 8729).
mikrotik: address: "192.168.0.1:8729" tls: truemikrotik.tls_insecure Optional
Section titled “mikrotik.tls_insecure ”Env: MIKROTIK_TLS_INSECURE · Default: false
Skip TLS certificate verification. Only needed when the router uses a self-signed certificate.
Timeouts
Section titled “Timeouts”mikrotik.connection_timeout Optional
Section titled “mikrotik.connection_timeout ”Env: MIKROTIK_CONN_TIMEOUT · Default: 10s
Maximum time to wait for the initial API connection. Uses Go duration format.
mikrotik.command_timeout Optional
Section titled “mikrotik.command_timeout ”Env: MIKROTIK_CMD_TIMEOUT · Default: 30s
Maximum time to wait for a single API command to complete. Increase if you have a slow router or large address lists.
Connection Pool
Section titled “Connection Pool”mikrotik.pool_size Optional
Section titled “mikrotik.pool_size ”Env: MIKROTIK_POOL_SIZE · Default: 4
How many RouterOS API sessions the bouncer can use for parallel work such as reconciliation removals. A higher value increases throughput when reconciliation has many stale address-list entries to delete; adds and live decisions always use the main connection, so they are not affected.
- Valid range: 1–20
- Auto-capping: On startup the bouncer queries the router’s API service
max-sessionslimit and automatically reduces the effective pool size so it never exceedsmax-sessions − 2(reserving connections for the main client and external tools such as WinBox).
mikrotik: pool_size: 8 # Higher parallelism for reconciliation removalsChecking the router limit
Section titled “Checking the router limit”The RouterOS API service has a max-sessions setting that limits simultaneous connections. The factory default is 20.
# Check current limit/ip/service/print where name=api
# Increase it (maximum supported value is 1000)/ip/service/set api max-sessions=1000