for ip in range(0, 256):
    packet = IP(dst='192.168.0.' + str(ip), ttl=20) / ICMP()
reply = sr1(packet, timeout=TIMEOUT)
if not reply is None:
    print(reply.dst, 'is online')
else:
    pass
Проверка диапазона IP-адресов с помощью Scapy