I don't care about the programming language, but C# or C/C++ would be preferable. Sadly, the platform must be Windows XP.
The goal is to ping out of a specific network interface on a multihomed machine, bypassing the routing table in the process.
In Linux/UNIX, this is trivial: simply ping out the interface with the existing ping utility. Windows XP does not provide this functionality.
I attempted to implement the UNIX behavior of ping using raw sockets to send custom made ICMP packets. I set the DontRoute socket option, bound the socket to a local endpoint, and sent the ICMP packet to the remote end point. In my tests, the source and destination addresses are correct, but the wrong interface is used to transmit the packet.
I've tried other avenues such as Cygwin. I could do it with a virtual machine running Linux. I also read somewhere that this is impossible in Windows XP, but possible on Vista/7. I'd be willing to consider manipulating the routing tables and/or interface metrics, if someone can prove that it works.
Words alone cannot express how deeply I hate Windows, so you can imagine how appreciative I'll be for any help.
Question
Vlad
I don't care about the programming language, but C# or C/C++ would be preferable. Sadly, the platform must be Windows XP.
The goal is to ping out of a specific network interface on a multihomed machine, bypassing the routing table in the process.
In Linux/UNIX, this is trivial: simply ping out the interface with the existing ping utility. Windows XP does not provide this functionality.
I attempted to implement the UNIX behavior of ping using raw sockets to send custom made ICMP packets. I set the DontRoute socket option, bound the socket to a local endpoint, and sent the ICMP packet to the remote end point. In my tests, the source and destination addresses are correct, but the wrong interface is used to transmit the packet.
I've tried other avenues such as Cygwin. I could do it with a virtual machine running Linux. I also read somewhere that this is impossible in Windows XP, but possible on Vista/7. I'd be willing to consider manipulating the routing tables and/or interface metrics, if someone can prove that it works.
Words alone cannot express how deeply I hate Windows, so you can imagine how appreciative I'll be for any help.
Link to comment
https://www.neowin.net/forum/topic/841800-ccc-force-windows-xp-to-ping-via-specific-interface/Share on other sites
4 answers to this question
Recommended Posts