The packet drop Gadget drops networking packets coming or going to given set of IP ranges.
- Install the
igbinary on Linux: https://inspektor-gadget.io/docs/latest/reference/install-linux - Build the gadget
$ sudo ig image build . -t packet_drop- (optional) Push the image to a container registry
$ sudo ig image tag packet_drop <registry>/<image>:<tag>
$ sudo ig image push <registry>/<image>:<tag>- Run the gadget
$ sudo ig run packet_drop --cidrs=192.168.1.0/16,8.8.8.8/32By default the gadget attaches to all running containers. To attach to a networking interface on the host use the --iface flag:
$ sudo ig run packet_drop --cidrs=192.168.1.0/16,8.8.8.8/32 --iface=eth0- Support IPv6