LinuxCommandLibrary

xdp-filter

XDP-based network packet filtering

TLDR

Load filter on interface

$ sudo xdp-filter load -p allow -m skb [network_interface]
copy
Unload filter
$ sudo xdp-filter unload [network_interface]
copy
Deny destination port
$ sudo xdp-filter port [destination_port]
copy
Deny source IP
$ sudo xdp-filter ip -m src [source_ip]
copy
Deny source MAC
$ sudo xdp-filter ether -m src [mac_address]
copy
Show statistics
$ sudo xdp-filter poll -i 10000
copy

SYNOPSIS

xdp-filter COMMAND [OPTIONS]

DESCRIPTION

xdp-filter loads and manages eBPF XDP (eXpress Data Path) packet filters. It provides high-performance packet filtering at the network driver level, before packets reach the kernel networking stack.
Part of the xdp-tools collection for managing XDP programs.

PARAMETERS

load INTERFACE

Load filter on network interface
unload INTERFACE
Unload filter from interface
port PORT
Filter by port number
ip ADDRESS
Filter by IP address
ether ADDRESS
Filter by MAC address
poll
Show statistics
-p, --policy POLICY
Set default policy (allow/deny)
-m, --mode MODE
Filter mode (src/dst for direction, skb/native for XDP mode)
-i, --interval MS
Poll interval in milliseconds

CAVEATS

Requires root privileges. Not all network drivers support native XDP mode. Filters operate at layer 2/3, not application layer.

SEE ALSO

iptables(8), nftables(8), tc(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community