# Ubiquiti EdgeRouter

Configuring flow accounting on a Ubiquiti EdgeRouter involves enabling NetFlow or IPFIX (Internet Protocol Flow Information Export) on the router, which allows it to collect and export flow data to NetObserv Flow. Here's a step-by-step guide on how to configure flow accounting on a Ubiquiti EdgeRouter using the Command Line Interface (CLI):

### Access the EdgeRouter CLI

Connect to your EdgeRouter 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.

### Enter configuration mode

Once logged in, enter configuration mode by typing the following command:

```shell
configure
```

### Configure the NetFlow or IPFIX settings

To enable NetFlow or IPFIX on the EdgeRouter, you'll need to configure the settings for the flow accounting protocol, including the interface(s) on which to monitor traffic, the version of the protocol, and the IP address and port of the remote flow collector or analyzer. Use the following commands, replacing the example values with your specific configuration:

**For NetFlow:**

```shell
set system flow-accounting netflow enable-egress
set system flow-accounting netflow interface ethX
set system flow-accounting netflow server x.x.x.x port yyyy
set system flow-accounting netflow version 9
```

**For IPFIX:**

```shell
set system flow-accounting ipfix enable-egress
set system flow-accounting ipfix interface ethX
set system flow-accounting ipfix server x.x.x.x port yyyy
set system flow-accounting ipfix version 10
```

Replace `ethX` with the interface you want to monitor (e.g., `eth0`), `x.x.x.x` with the IP address of NetObserv Flow, and `yyyy` with the desired port number for NetObserv Flow (e.g., `2055`).

### Commit and save the changes

After configuring the flow accounting settings, commit and save the changes by entering the following commands:

```shell
commit
save
```

### Exit configuration mode

Type `exit` to leave configuration mode and return to the EdgeRouter CLI.

### Verify the configuration

To verify that flow accounting is configured correctly, use the following command:

```shell
show system flow-accounting
```

This command should display the flow accounting settings you just configured.

Once you've completed these steps, your Ubiquiti EdgeRouter will start exporting flow data to the specified flow collector or analyzer. Make sure your that 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_ubiquiti_edgerouter.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.
