Skip to content

Instantly share code, notes, and snippets.

@velp
Last active January 17, 2024 15:16
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 velp/3a2555f14c2b07306fe0eef273fbd577 to your computer and use it in GitHub Desktop.
Save velp/3a2555f14c2b07306fe0eef273fbd577 to your computer and use it in GitHub Desktop.
openstack-commands.md

Check all Floating IP by open TCP ports in Security Groups

openstack floating ip list -f value | while read fip; do echo -e "\e[32m===> Check IP $(echo $fip | awk '{print $2}')\e[0m"; openstack port show $(echo $fip | awk '{print $4}') -c security_group_ids -f json | jq '.security_group_ids[]' -r | while read sg; do openstack security group rule list $sg --ingress --protocol tcp --ethertype IPv4 -c "Port Range" -f value | while read ports; do nc -nzv -w2 $(echo $fip | awk '{print $2}') $(echo $ports | sed 's/:.*//g') ; done; done ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment