Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 794 Bytes

File metadata and controls

35 lines (23 loc) · 794 Bytes

packet drop

The packet drop Gadget drops networking packets coming or going to given set of IP ranges.

Usage

  1. Install the ig binary on Linux: https://inspektor-gadget.io/docs/latest/reference/install-linux
  2. Build the gadget
$ sudo ig image build . -t packet_drop
  1. (optional) Push the image to a container registry
$ sudo ig image tag packet_drop <registry>/<image>:<tag>
$ sudo ig image push <registry>/<image>:<tag>
  1. Run the gadget
$ sudo ig run packet_drop --cidrs=192.168.1.0/16,8.8.8.8/32

By 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

TODO

  • Support IPv6