lizrice / ebpf-beginners

The beginner's guide to eBPF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

packet.py doesn't work

wangsu502 opened this issue · comments

Hi Liz,
I got the following error, could you help to figure out what was wrong?

root@iubuntu2004:~/ebpf-beginners# python3.9 packet.py
bpf: Attaching prog to eth0: Operation not supportedTraceback (most recent call last):
File "/root/ebpf-beginners/packet.py", line 32, in
b.attach_xdp(dev="eth0", fn=b.load_func("hello_packet",
File "/usr/lib/python3/dist-packages/bcc/init.py", line 726, in attach_xdp
raise Exception("Failed to attach BPF to device %s: %s"
Exception: Failed to attach BPF to device b'eth0': Success

same problem

Hi @peiqiaoWang @wangsu502, just change eth0 with your actual network interface, for example: ens3.