Trying to load a XDP program fails

Hey, I'm writing a BPF program which I would like to load into OpenWRT instance, I'm running the OpenWRT on virtual box, these are my adapters:

(Sorry for the image, for some reason I can't copy from the VM)

Anyways, I've wrote a simple BPF program to block port 80 traffic
I have downloaded the compiled program into the VM (block_http.elf)

I'm trying to load the program using iproute2 via:
ip link set dev eth0 xdp obj block_http.elf
And I get the next error:
ip: either "dev" is duplicate, or "xdp" is garbage"

Because its a virtual image of a console. You'd need to SSH to copy.

  • Have you verified you installed an loaded any of the needed modules?
  • I'm sure that you'll need to install ip-full

Yep, installing that fixed the problem and brought in a new one!
I'm now getting en error (with the same command) which says:
Error fetching program/map!
That might not be OpenWRT related but I'll be happy to get some help :]

Try these packages:

Doesn't seem like anything I need, I want to load a BPF program. I've brought out the port 80 blocker as an example.
I'm not looking to use pre-built packages that run at the BPF level.

1 Like