# MikroTik RouterOS

MikroTik RouterOS supports flow-based network traffic analysis using Traffic Flow, which is similar to IPFIX or NetFlow. To configure Traffic Flow on a MikroTik RouterOS device, follow these steps:

### Access the router CLI

Connect to your MikroTik router via SSH or a console cable. If connecting via SSH, use a tool like PuTTY or the built-in SSH client in your terminal, and enter the router's IP address, username, and password to log in.

### Enable Traffic Flow

Enter the following command to enable Traffic Flow on the router:

```shell
/ip traffic-flow set enabled=yes
```

### Configure Traffic Flow settings

To configure Traffic Flow settings, including the interface(s) to monitor and the IP address and port of the remote flow collector, use the following commands:

```shell
/ip traffic-flow target add address=x.x.x.x:yyyy version=10
/ip traffic-flow interfaces add interface=INTERFACE_NAME
```

Replace `x.x.x.x` with the IP address of NetObserv Flow, `yyyy` with the desired port number for NetObserv Flow (e.g., `4739` for IPFIX), and `INTERFACE_NAME` with the name of the interface you want to monitor (e.g., `ether1`).

#### Optional

Configure Traffic Flow cache settings: If you want to customize the cache settings for Traffic Flow, such as timeouts and cache size, use the following command:

```shell
/ip traffic-flow set cache-entries=4096 active-flow-timeout=1m inactive-flow-timeout=15s
```

Adjust the values for `cache-entries`, `active-flow-timeout`, and `inactive-flow-timeout` as needed.

### Save the configuration

To save your configuration changes, use the following command:

```shell
/system configuration save
```

### Verify the configuration

To verify that Traffic Flow is configured correctly and exporting flow data, use the following command:

```shell
/ip traffic-flow print
```

This command should display the Traffic Flow settings you just configured.

Once you have completed these steps, your MikroTik RouterOS device will start exporting flow data using Traffic Flow (similar to IPFIX) to the specified ElastiFlow NetObserv Flow. Make sure NetObserv Flow is set up to receive and process the exported data for analysis and monitoring purposes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elastiflow.com/additional-resources-reference-articles/guides/configuring-flow-logs-on-devices/device_flow_mikrotik_routeros.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
