Skip to content

Instantly share code, notes, and snippets.

@wido
Created November 14, 2018 12:35
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 wido/1383c6e48f79f8947de11aee17e2ab4a to your computer and use it in GitHub Desktop.
Save wido/1383c6e48f79f8947de11aee17e2ab4a to your computer and use it in GitHub Desktop.
Calculate CloudStack VXLAN VNI Multicast Group
#!/bin/bash
#
# Calculate the IPv4 Multicast Group that Apache CloudStack will use
# for a VNI
#
# Also see modifyvxlan.sh in CloudStack repository
#
# Author: Wido den Hollander <wido@widodh.nl>
#
VNI=$1
if [ -z "$1" ]; then
echo "Usage: $0 <vni>"
exit 1
fi
GROUP="239.$(( ($VNI >> 16) % 256 )).$(( ($VNI >> 8) % 256 )).$(( $VNI % 256 ))"
echo $GROUP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment