|
|
@ -188,7 +188,6 @@ Then setup the `ebpf-filter-file` variable in af-packet section in ``suricata.ya
|
|
|
|
# eBPF file containing a 'filter' function that will be inserted into the
|
|
|
|
# eBPF file containing a 'filter' function that will be inserted into the
|
|
|
|
# kernel and used as load balancing function
|
|
|
|
# kernel and used as load balancing function
|
|
|
|
ebpf-filter-file: /usr/libexec/suricata/ebpf/vlan_filter.bpf
|
|
|
|
ebpf-filter-file: /usr/libexec/suricata/ebpf/vlan_filter.bpf
|
|
|
|
use-mmap: yes
|
|
|
|
|
|
|
|
ring-size: 200000
|
|
|
|
ring-size: 200000
|
|
|
|
|
|
|
|
|
|
|
|
You can then run Suricata normally ::
|
|
|
|
You can then run Suricata normally ::
|
|
|
@ -209,7 +208,6 @@ update af-packet configuration in ``suricata.yaml`` to set bypass to `yes` ::
|
|
|
|
# kernel and used as packet filter function
|
|
|
|
# kernel and used as packet filter function
|
|
|
|
ebpf-filter-file: /usr/libexec/suricata/ebpf/bypass_filter.bpf
|
|
|
|
ebpf-filter-file: /usr/libexec/suricata/ebpf/bypass_filter.bpf
|
|
|
|
bypass: yes
|
|
|
|
bypass: yes
|
|
|
|
use-mmap: yes
|
|
|
|
|
|
|
|
ring-size: 200000
|
|
|
|
ring-size: 200000
|
|
|
|
|
|
|
|
|
|
|
|
Constraints on eBPF code to have a bypass compliant code are stronger than for regular filters. The
|
|
|
|
Constraints on eBPF code to have a bypass compliant code are stronger than for regular filters. The
|
|
|
@ -246,7 +244,6 @@ and point the ``ebpf-lb-file`` variable to the ``lb.bpf`` file ::
|
|
|
|
# eBPF file containing a 'loadbalancer' function that will be inserted into the
|
|
|
|
# eBPF file containing a 'loadbalancer' function that will be inserted into the
|
|
|
|
# kernel and used as load balancing function
|
|
|
|
# kernel and used as load balancing function
|
|
|
|
ebpf-lb-file: /usr/libexec/suricata/ebpf/lb.bpf
|
|
|
|
ebpf-lb-file: /usr/libexec/suricata/ebpf/lb.bpf
|
|
|
|
use-mmap: yes
|
|
|
|
|
|
|
|
ring-size: 200000
|
|
|
|
ring-size: 200000
|
|
|
|
|
|
|
|
|
|
|
|
Setup XDP bypass
|
|
|
|
Setup XDP bypass
|
|
|
@ -281,7 +278,6 @@ also use the ``/usr/libexec/suricata/ebpf/xdp_filter.bpf`` (in our example TCP o
|
|
|
|
# if the ebpf filter implements a bypass function, you can set 'bypass' to
|
|
|
|
# if the ebpf filter implements a bypass function, you can set 'bypass' to
|
|
|
|
# yes and benefit from these feature
|
|
|
|
# yes and benefit from these feature
|
|
|
|
bypass: yes
|
|
|
|
bypass: yes
|
|
|
|
use-mmap: yes
|
|
|
|
|
|
|
|
ring-size: 200000
|
|
|
|
ring-size: 200000
|
|
|
|
# Uncomment the following if you are using hardware XDP with
|
|
|
|
# Uncomment the following if you are using hardware XDP with
|
|
|
|
# a card like Netronome (default value is yes)
|
|
|
|
# a card like Netronome (default value is yes)
|
|
|
@ -384,7 +380,6 @@ A sample configuration for pure XDP load balancing could look like ::
|
|
|
|
xdp-mode: driver
|
|
|
|
xdp-mode: driver
|
|
|
|
xdp-filter-file: /usr/libexec/suricata/ebpf/xdp_lb.bpf
|
|
|
|
xdp-filter-file: /usr/libexec/suricata/ebpf/xdp_lb.bpf
|
|
|
|
xdp-cpu-redirect: ["1-17"] # or ["all"] to load balance on all CPUs
|
|
|
|
xdp-cpu-redirect: ["1-17"] # or ["all"] to load balance on all CPUs
|
|
|
|
use-mmap: yes
|
|
|
|
|
|
|
|
ring-size: 200000
|
|
|
|
ring-size: 200000
|
|
|
|
|
|
|
|
|
|
|
|
It is possible to use `xdp_monitor` to have information about the behavior of CPU redirect. This
|
|
|
|
It is possible to use `xdp_monitor` to have information about the behavior of CPU redirect. This
|
|
|
|