Skip to content

Instantly share code, notes, and snippets.

@paulperegud
Created December 9, 2016 16:36
Show Gist options
  • Save paulperegud/de1d572218e4a7f84e194b501bcfc4dd to your computer and use it in GitHub Desktop.
Save paulperegud/de1d572218e4a7f84e194b501bcfc4dd to your computer and use it in GitHub Desktop.
#!/usr/sbin/nft -f
# to list rules: nft list table t
# to remove rules: nft flush table t
define nodes = { 200.69.141.134, 52.40.149.71, 45.32.83.15 }
add table t
add chain ip t input { type filter hook input priority 0; policy accept; }
add rule t input ip daddr $nodes drop
add chain ip t output { type filter hook output priority 0; policy accept; }
add rule t output ip daddr $nodes drop
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment