-
-
Save phyoewaipaing/4dcb3b9a25acf7d53ec3c9a3abdcd7ad to your computer and use it in GitHub Desktop.
Scan IP Addresses through VMK Adapter
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 | |
## This script will ping IP addresses in a sequential order by using the vmk in the esxi host ## | |
# Define the range of IP addresses | |
START_IP=201 | |
END_IP=210 | |
# Define the first three octets | |
BASE_IP="192.168.218" | |
# Interface name | |
NetworkStackName="vmotion" | |
# Loop through the IP addresses | |
for i in $(seq $START_IP $END_IP); do | |
IP="$BASE_IP.$i" | |
vmkping -S $NetworkStackName -W1 -c2 $IP &> /dev/null | |
if [ $? -eq 0 ]; then | |
echo "$IP is reachable" | |
else | |
echo "$IP is not reachable" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment