I'm assuming you're on linux. One way is to use raw sockets. Another is to go with policy routing.
The (iputils) ping utility has -m option to mark the packets. So it's just a matter of setting up multiple routing tables with ip rule ... and ip route ....
Google for "policy routing fwmark", "multiple default route", etc.
In reply to Re: ping an IPv4 address, using different gateways
by Anonymous Monk
in thread ping an IPv4 address, using different gateways
by igoryonya
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |