# Arista

### **1. Enable sFlow globally**

```eos
sflow run
sflow agent <interface>            ! interface for sFlow agent IP (usually loopback)
sflow collector <collector-ip> <udp-port> vrf <vrf-name>
sflow sample <rate>                ! e.g. 4096 (1 out of every 4096 packets)
sflow polling-interval <seconds>   ! e.g. 30
```

Example:

```eos
sflow run
sflow agent Loopback0
sflow collector 192.0.2.10 6343 vrf default
sflow sample 4096
sflow polling-interval 30
```

### **2. Enable sFlow on interfaces**

```eos
interface Ethernet1
   sflow enable
!
interface Ethernet2
   sflow enable
```

### **3. Enable BGP for Flow Export (Optional: BGP-LS / BMP / FlowSpec)**

If you want **flow data enriched with routing/BGP context**, you usually:

* Run BGP on the router.
* Export sFlow to a collector (Kentik, InMon, ElastiFlow, etc.) that can ingest BGP data.
* Export the routing table to the same collector, so flows get annotated with AS-path, prefix, community, etc.

Example (simple BGP config):

```eos
router bgp 65001
   router-id 203.0.113.1
   neighbor 192.0.2.20 remote-as 65002
   !
   address-family ipv4
      neighbor 192.0.2.20 activate
```

The collector (not the switch) does the **join** between sFlow records and BGP routing information.


---

# 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/arista.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.
