Skip to content

Instantly share code, notes, and snippets.

@JohannesGolf
Last active August 29, 2015 14:01
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 JohannesGolf/ae1f5ca13d881e487011 to your computer and use it in GitHub Desktop.
Save JohannesGolf/ae1f5ca13d881e487011 to your computer and use it in GitHub Desktop.
Informationen per Ping-Befehl
import subprocess
subprocess.os.system("sudo arp -a -d")
print " "
print "###################"
print "Programm Start"
print "###################"
print " "
times = int(raw_input("Gib den Host-Anteil der ersten IP-Adresse ein, die getestet werden soll: "))
ip_host = int(raw_input("Gib den Host-Anteil der letzten IP-Adresse ein, die getestet werden soll: "))
free_ip_list = []
remit_ip_list = []
while times <= ip_host:
ip = 'X.X.X.' + str(times)
if subprocess.os.system("ping -c 2 " + ip) == 0:
remit_ip_list.append(ip)
else:
free_ip_list.append(ip)
print " "
print "------------------"
times = times + 1
print "Name IP-Adresse MAC-Adresse"
subprocess.os.system("sudo arp -a")
print " "
print "Vergebene IP's:"
print remit_ip_list
print "Freie/Nichterreichbare IP's:"
print free_ip_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment