Troubleshooting
Connection issues
Section titled “Connection issues”Cannot connect to MikroTik
Section titled “Cannot connect to MikroTik”-
Verify the API service is enabled
/ip/service/print where name=api -
Check the port matches your configuration (default: 8728, TLS: 8729)
-
Verify firewall rules allow access from the bouncer’s IP
-
If using Docker, ensure the container can reach the router network
Authentication failed
Section titled “Authentication failed”-
Verify credentials in your configuration file
-
Check the user exists and has the correct group
/user/print where name=crowdsec -
Verify the user’s group has required policies:
api,read,write -
Check allowed address restrictions on the user account
TLS certificate errors
Section titled “TLS certificate errors”-
For self-signed certificates, set the CA path:
crowdsec:ca_cert_path: "/path/to/ca.pem" -
Verify the certificate is valid and not expired
-
Check the hostname matches the certificate’s CN or SAN
CrowdSec LAPI issues
Section titled “CrowdSec LAPI issues”Cannot connect to LAPI
Section titled “Cannot connect to LAPI”-
Verify the LAPI URL
Terminal window curl http://localhost:8080/v1/decisions -
Check the bouncer API key
Terminal window cscli bouncers list -
If CrowdSec runs in Docker, ensure network connectivity between containers
No decisions received
Section titled “No decisions received”Possible causes:
- No active decisions — check with
cscli decisions list - Origin filtering too restrictive — check
crowdsec.originsconfig - Scenario filtering excludes all — check
crowdsec.scenarios_containing/crowdsec.scenarios_not_containing - CrowdSec engine not detecting threats — check CrowdSec logs
Firewall rule issues
Section titled “Firewall rule issues”Rules not created
Section titled “Rules not created”-
Check filter and raw are enabled
firewall:filter:enabled: trueraw:enabled: true -
Look for errors in logs
Terminal window journalctl -u cs-routeros-bouncer -f -
Verify the user has
writepolicy for firewall operations
Rules in wrong position
Section titled “Rules in wrong position”-
Verify
rule_placement: "top"in configuration -
Check for dynamic rules at position 0 (the bouncer skips these and places after)
-
Inspect positions manually
/ip/firewall/filter print/ip/firewall/raw print
Performance issues
Section titled “Performance issues”High CPU during reconciliation
Section titled “High CPU during reconciliation”Performance benchmarks:
| List size | Time | CPU peak |
|---|---|---|
| ~1,500 IPs (local) | ~9 s | ~14% |
| ~25,000 IPs (full CAPI) | ~2 min 50 s | ~23% |
To reduce impact:
- Filter synced decisions with
origins:crowdsec:origins: ["crowdsec", "cscli"] - Schedule bouncer restarts during low-traffic periods
- CPU impact is temporary — only during reconciliation
Logging and debugging
Section titled “Logging and debugging”logging: level: "debug"Or via environment variable:
LOG_LEVEL=debug cs-routeros-bouncer run -c config.ymlcurl http://localhost:2112/healthcurl http://localhost:2112/metrics# View address list entries/ip/firewall/address-list print where list=crowdsec-banned
# Count entries/ip/firewall/address-list print count-only where list=crowdsec-banned
# View bouncer firewall rules/ip/firewall/filter print where comment~"crowdsec-bouncer"/ip/firewall/raw print where comment~"crowdsec-bouncer"Docker-specific issues
Section titled “Docker-specific issues”Container cannot reach router
Section titled “Container cannot reach router”-
Use host networking in Docker Compose:
services:cs-routeros-bouncer:network_mode: host -
Or ensure the Docker network can route to the router’s IP
-
Check DNS resolution if using hostnames
Permission denied for config file
Section titled “Permission denied for config file”-
Check file permissions:
chmod 644 config.yml -
If using Docker secrets, ensure the secret is properly mounted
-
Or use environment variables instead of a config file