raboyd
May 5th, 2008, 05:48 PM
Hi guys,
I'm actually programming in perl but believe this is a Windows programming gotcha.
On a multihomed system I am sending packets over a raw socket. If I bind to an IP address with a higher metric in the route table, the packet actually goes out an interface with a lower metric in the route table. The IP src addr in the packet is still the bound IP address. I think I am hitting the route feature as described in the following.
http://blogs.msdn.com/zhengpei/archive/2007/04/25/socket-binding-on-a-multihomed-host.aspx
Quoted from above link:
"Even if you call bind() to bind the socket to a specific local address (which means connection manager's AutoLSP is not associated with the socket), still your packets on this socket are subject to the routing decision in terms of choosing which physical interface will be used. "
Does anyone know if this is the case? Is there anyway around this? I'm trying to use Pcap to grab packets and am finding it impossible since my packets are going out a different interface than I expect!
Thanks,
Mona
[Added] This is expected behavior, see "Windows Socket Connection from a Multiple-Homed Computer" at http://support.microsoft.com/kb/175396
posted by MikeAThon in "Local socket binding on multihomed host in Windows XP does not work" thread.
Still don't know if there is a workaround...
I'm actually programming in perl but believe this is a Windows programming gotcha.
On a multihomed system I am sending packets over a raw socket. If I bind to an IP address with a higher metric in the route table, the packet actually goes out an interface with a lower metric in the route table. The IP src addr in the packet is still the bound IP address. I think I am hitting the route feature as described in the following.
http://blogs.msdn.com/zhengpei/archive/2007/04/25/socket-binding-on-a-multihomed-host.aspx
Quoted from above link:
"Even if you call bind() to bind the socket to a specific local address (which means connection manager's AutoLSP is not associated with the socket), still your packets on this socket are subject to the routing decision in terms of choosing which physical interface will be used. "
Does anyone know if this is the case? Is there anyway around this? I'm trying to use Pcap to grab packets and am finding it impossible since my packets are going out a different interface than I expect!
Thanks,
Mona
[Added] This is expected behavior, see "Windows Socket Connection from a Multiple-Homed Computer" at http://support.microsoft.com/kb/175396
posted by MikeAThon in "Local socket binding on multihomed host in Windows XP does not work" thread.
Still don't know if there is a workaround...