I'm trying to change this implementation of ping so I can set a different source address for the messages.
What I want to do is exactly the same thing that the -S
option of the original ping can do:
ifconfig em0 10.0.1.1 netmask 255.255.255.0 alias
ifconfig em0 10.0.2.1 netmask 255.255.255.0 alias
ping -c4 -S 10.0.1.1 10.0.2.1
This works of course but I would like to do the same thing with Python.