Код: Выделить всё
sudo bpftool prog load filter.bpf.o /sys/fs/bpf/filter
Код: Выделить всё
$ bpftool net help
Usage: bpftool net { show | list } [dev ]
bpftool net attach ATTACH_TYPE PROG dev [ overwrite ]
bpftool net detach ATTACH_TYPE dev
bpftool net help
PROG := { id PROG_ID | pinned FILE | tag PROG_TAG | name PROG_NAME }
ATTACH_TYPE := { xdp | xdpgeneric | xdpdrv | xdpoffload | tcx_ingress
| tcx_egress }
OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} }
Note: Only xdp, tcx, tc, netkit, flow_dissector and netfilter attachments
are currently supported.
For progs attached to cgroups, use "bpftool cgroup"
to dump program attachments. For program types
sk_{filter,skb,msg,reuseport} and lwt/seg6, please
consult iproute2.
Код: Выделить всё
bpftoolКод: Выделить всё
$ sudo bpftool net attach netfilter id 122 dev eth0
Error: invalid net attach/detach type: netfilter
Подробнее здесь: https://stackoverflow.com/questions/791 ... th-bpftool
Мобильная версия