# OpenWRT (softflowd)

Softflowd is a flow-based network traffic analyzer that can be used to export flow data using NetFlow protocol. To configure `softflowd` on an OpenWRT router, follow these steps:

### Install softflowd

First, you need to install the `softflowd` package on your OpenWRT router. Connect to the router via SSH or use the built-in terminal in the LuCI web interface. Once connected, run the following command to update the package list and install `softflowd`:

```shell
opkg update
opkg install softflowd
```

### Configure softflowd

To configure softflowd, you need to create a configuration file. The default configuration file is located at `/etc/config/softflowd`. You can create and edit this file using the `vi` editor or another text editor of your choice:

```shell
vi /etc/config/softflowd
```

Add the following lines to the configuration file, replacing the example values with your specific configuration:

```shell
config softflowd
    option enabled        '1'
    option interface      'br-lan'
    option timeout        'tcp.rst=10'
    option timeout        'tcp.fin=10'
    option timeout        'expint=10'
    option timeout        'icmp=20'
    option timeout        'tcp=60'
    option timeout        'maxlife=60'
    option timeout        'general=60'
    option timeout        'udp=60'
    option max_flows      '8192'
    option host_port      '192.0.2.11:2055'
    option pid_file       '/var/run/softflowd.pid'
    option control_socket '/var/run/softflowd.ctl'
    option export_version '9'
    option hoplimit       '255'
    option tracking_level 'ether'
    option track_ipv6     '1'
    option sampling_rate  '1'
```

Replace `br-lan` with the interface you want to monitor, and `192.0.2.11:2055` with the IP address and port number of your ElastiFlow NetObserv Flow. Adjust other options as needed.

### Start softflowd

To start `softflowd`, run the following command:

```shell
/etc/init.d/softflowd start
```

### Enable softflowd on startup

To ensure that `softflowd` starts automatically when the router boots, run the following command:

```shell
/etc/init.d/softflowd enable
```

### Verify softflowd is running

To verify that `softflowd` is running and exporting flow data, you can check the status with the following command:

```shell
/etc/init.d/softflowd status
```

Once you have completed these steps, softflowd will start exporting flow data to 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_openwrt_softflowd.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.
