Created
November 14, 2018 12:35
-
-
Save wido/1383c6e48f79f8947de11aee17e2ab4a to your computer and use it in GitHub Desktop.
Calculate CloudStack VXLAN VNI Multicast Group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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