Start VM instance with Vagrant.
$ vagrant up
$ vagrant ssh
Install packages.
$ sudo apt update
$ sudo apt install clang iproute2
Prevent 'asm/types.h' file not found
error.
$ sudo ln -s /usr/include/x86_64-linux-gnu/asm/ /usr/include/asm
Compile XDP program with clang.
$ clang -O2 -Wall -target bpf -c xdp_drop.c -o xdp_drop.o
Attach XDP program to enp0s8.
$ sudo ip link set dev enp0s8 xdp obj xdp_drop.o
$ sudo ip link show dev enp0s8
Detach XDP program from enp0s8.
$ sudo ip link set dev enp0s8 xdp off