Skip to content

Instantly share code, notes, and snippets.

@eusonlito
Created November 3, 2023 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eusonlito/053396ee75f95c3d80bd066e188408f2 to your computer and use it in GitHub Desktop.
Save eusonlito/053396ee75f95c3d80bd066e188408f2 to your computer and use it in GitHub Desktop.
Find IP in ipset lists
ip="XXX.XXX.XXX.XXX"
for set in $(ipset list -n); do
ipset test $set $ip &> /dev/null && echo "IP $ip found in $set"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment