I finally got Suricata to operate in IDS/IPS on af-packet mode (which is the ONLY mode available for our Entware build, I was trying to get a PF_RING build but was having some issues with libraries and other Entware dependencies). Below is the relevant yaml code from my own config. mmap (memory mapped ring buffers) must be enabled for IPS to work, without it, it's only running in IDS mode. I'm running this on my AC86U (with suricata, I kinda wish I have the newer AX88U not for its wifi but for its quad core CPU and 1 GB of real RAM). The configuration is a good compromise for my own build, the average load on my router is around 3.50 so your router will be hotter with it. Download speed is close to my native ISP speed (which is around 200 Mbps), upload speed is somewhat limited around 160 Mbps which is far below my normal ISP speed of 225 Mbps (this is due to AC86U's CPU capability). I'm running CakeQoS as well (I don't like the proprietary closed sourced solutions from TrendMicro as it causes some random kernel panics on my own fork with their modules which I can't fix, I much prefer the GPL alternative which is Suricata+CakeQoS). You will experience around 2.1% packet drops (again this is due to dual core and limited real RAM of AC86U). I can live with this small amount of packet drops as I didn't experience any real usage issues with such packet loss.
Thanks to all those who contributed so far, it took me a while to read through tons of source code from Suricata and their piss poor documentations/examples to finally crack this.
YAML:
# Linux high speed capture support
af-packet:
- interface: eth0 ## set your wan interface
copy-mode: ips
copy-iface: br0
buffer-size: 3072
cluster-id: 99
cluster-type: cluster_flow
use-mmap: yes
# mmap-locked: yes
tpacket-v2: yes
ring-size: 3072
- interface: br0
copy-mode: ips
copy-iface: eth0
buffer-size: 3072
cluster-id: 98
cluster-type: cluster_flow
use-mmap: yes
# mmap-locked: yes
tpacket-v2: yes
ring-size: 3072
EDIT: changed tpacket-v3 to tpacket-v2 for better latency