# Error load lb. bpf file when using load balancing for af-packet?

**URL:** <https://forum.suricata.io/t/error-load-lb-bpf-file-when-using-load-balancing-for-af-packet/1168>\
**Category:** Help\
**Tags:** ips\
**Created:** [March 2, 2021, 2:12am UTC](https://forum.suricata.io/t/error-load-lb-bpf-file-when-using-load-balancing-for-af-packet/1168 "2021-03-02T02:12:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jydr](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jydr](https://forum.suricata.io/u/jydr)\
**Post date:** [March 2, 2021, 2:12am UTC](https://forum.suricata.io/t/error-load-lb-bpf-file-when-using-load-balancing-for-af-packet/1168/1 "2021-03-02T02:12:37Z")

</div>

system: ubuntu 18.04  
kernel version: 5.4.0-66-generic  
AF-PACKET IPS mode suricata.yaml configuration is as follows

- interface: eth0  
threads: 16  
defrag: no  
cluster-type: cluster\_ebpf  
ebpf-lb-file: /usr/libexec/suricata/ebpf/lb.bpf  
cluster-id: 98  
copy-mode: ips  
copy-iface: eth1  
buffer-size: 64535  
use-mmap: yes
- interface: eth1  
threads: 16  
cluster-id: 97  
defrag: no  
cluster-type: cluster\_ebpf  
ebpf-lb-file: /usr/libexec/suricata/ebpf/lb.bpf  
copy-mode: ips  
copy-iface: eth0  
buffer-size: 64535  
use-mmap: yes

The packet loss rate of af-packet ips mode is serious when a large amount of data is transmitted, so I plan to use EBPF load balancing.  
The lb. BPF file I used was compiled by Suricata. Why do always show lb. bpf file error?

 ![11](https://canada1.discourse-cdn.com/flex030/uploads/suricata/original/1X/691119ff8f86b6b5e5ff81c1aae3b08de4dec568.jpeg)

---

<div class="post-metadata">

**Author:** ![Andreas\_Herz](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/andreas_herz/32/52_2.png) [@Andreas\_Herz](https://forum.suricata.io/u/Andreas_Herz)\
**Post date:** [March 7, 2021, 8:19pm UTC](https://forum.suricata.io/t/error-load-lb-bpf-file-when-using-load-balancing-for-af-packet/1168/2 "2021-03-07T20:19:34Z")

</div>

Can you post the bpf file?

---

<div class="post-metadata">

**Author:** ![masual](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/masual/32/697_2.png) [@masual](https://forum.suricata.io/u/masual)\
**Post date:** [April 7, 2021, 9:25am UTC](https://forum.suricata.io/t/error-load-lb-bpf-file-when-using-load-balancing-for-af-packet/1168/3 "2021-04-07T09:25:25Z")

</div>

Which **libbpf** version are you using? I got the same error when using 0.2 or 0.3 releases, but I manage to make suricata load de **lb.bpf** file when compiling with libbpf 0.1.1: [Release libbpf v0.1.1 · libbpf/libbpf · GitHub](https://github.com/libbpf/libbpf/releases/tag/v0.1.1)

At the moment I am not able to configure Suricata properly to take advantage of this LB mechanism, but the bpf program is loaded. You can check if the program is loaded in the kernel using `bpftool prog show`  
If I am not mistaken, It should display something like this:

```
282: socket_filter name lb tag aea71c9d2ee3224c gpl
        loaded_at 2021-04-07T11:18:21+0200 uid 0
        xlated 1792B jited 972B memlock 4096B
286: socket_filter name lb tag aea71c9d2ee3224c gpl
        loaded_at 2021-04-07T11:18:21+0200 uid 0
        xlated 1792B jited 972B memlock 4096B

```

Hope this helps.
