# BPF filter file with af\_packet not functioning

**URL:** <https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199>\
**Category:** Help\
**Created:** [May 4, 2020, 9:42pm UTC](https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199 "2020-05-04T21:42:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReignInChaos](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@ReignInChaos](https://forum.suricata.io/u/ReignInChaos)\
**Post date:** [May 4, 2020, 9:42pm UTC](https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199/1 "2020-05-04T21:42:56Z")

</div>

Looking for some assistance getting Suricata configuration to function with af\_packet and setting a BPF filter file. I am setting bpf-filter: under af\_packet in suricata.yaml however getting the error below:

(source-af-packet.c:2274) (AFPSetBPFFilter) – [ERRCODE: SC\_ERR\_AFP\_CREATE(190)] - Failed to compile BPF “”: syntax error

I’ve tested with an inline BPF filter in the configuration and it seems to function.

Is setting the filename not an option in the configuration?

---

<div class="post-metadata">

**Author:** ![pevma](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/pevma/32/29_2.png) [@pevma](https://forum.suricata.io/u/pevma)\
**Post date:** [May 5, 2020, 6:13am UTC](https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199/2 "2020-05-05T06:13:49Z")

</div>

Not directly yet in the yaml config in af-packet [Feature #3439: bpf-filter does not accept path/file - Suricata - Open Information Security Foundation](https://redmine.openinfosecfoundation.org/issues/3439)  
But you can specify it on the command line

> suricata -F bp.filter

---

<div class="post-metadata">

**Author:** ![ReignInChaos](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@ReignInChaos](https://forum.suricata.io/u/ReignInChaos)\
**Post date:** [May 5, 2020, 11:55am UTC](https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199/3 "2020-05-05T11:55:29Z")

</div>

Understood and thanks for providing the ticket. I wasn’t able to deduce if this was being worked on or targeted for a release.

---

<div class="post-metadata">

**Author:** ![vjulien](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/vjulien/32/4_2.png) [@vjulien](https://forum.suricata.io/u/vjulien)\
**Post date:** [May 5, 2020, 12:38pm UTC](https://forum.suricata.io/t/bpf-filter-file-with-af-packet-not-functioning/199/4 "2020-05-05T12:38:54Z")

</div>

If you’re willing and able to test, see [https://github.com/OISF/suricata/pull/4834](https://github.com/OISF/suricata/pull/4834)
