UnixServerAdmin

Server Administration & Management

How to check duplicate IP adderss in your subnet

Create and execute a script as shown below to check for duplicate IP in example: 192.168.1.0/24 subnet.

###############################################################
# /bin/bash #######################################################
# duplicate.sh #####################################################
##############################################################
for i in $(seq 1 254);
do
echo “arping -q -D -I eth0 -c 2 172.16.1.${i}”; [ $? -ne 0 ] && echo “172.16.1.${i} duplicate”;
done
##############################################################

September 9, 2012 - Posted by | Security, Shell Script, Tips & Tricks, Unix/Linux | , , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: