Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
the following script is working perfectly fine for IPv4 but however my job is to do same for IPv6..
#!/usr/bin/python
import pyping
response = pyping.ping('8.8.8.8')
if response.ret_code == 0:
print("reachable")
else:
print("unreachable")
is there any way.. i tried to install aioping or aio_ping.. but didnt work,.. is there any workaround to run the same as above for IPv6 in linux machines
–
–
–
Using the example from the multi-ping (pip install multiping
) documentation:
from multiping import MultiPing
# Create a MultiPing object
mp = MultiPing(["2a00:1450:4005:803::200e"])
# Send the pings to those addresses
mp.send()
# With a 1 second timout, wait for responses (may return sooner if all
# results are received).
responses, no_responses = mp.receive(1)
if responses:
print("reachable: %s" % responses)
if no_responses:
print("unreachable: %s" % no_responses)
Have a look at the documentation to see how responses
/no_responses
are structured and how to ping multiple addresses simultaneously.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.