title: Windows 7 temporarily routes UDP packets for local network to default gateway
body: <p>I have a Windows service running on a multi-homed Windows 7 machine communicating via UDP to a machine on the local network. This works fine, except sometimes during Windows startup the network traffic is temporarily (30 seconds) being routed to the default gateway, resulting in UDP packet loss. This packet loss is not necessarily a problem, but leads to an unnecessarily long startup time of the application. </p>
  
  <p>The service binds to the socket using INADDR_ANY. Now when I change this to bind to the IP address of the control network NIC (192.168.32.1) I don't observe the problem. However I don't understand why the binding matters in this situation, and also I don't understand why the problem is there only temporarily. Do any of you have an explanation for this?</p>
  
  <p>Besides my curiosity to find the root cause of this issue, I would also like to get an answer to this question so I can remove the bind to the specific IP address from my code. This decouples my application code from the network layout.</p>
  
  <p>Network details:</p>
  
  <ul>
  <li>Machine A, Windows 7, two NICs:
  
  <ul>
  <li>NIC #1 (ext network): 192.168.116.x/23 (DHCP), gateway 192.168.117.1</li>
  <li>NIC #2 (int network):  192.168.32.1/26 (fixed)</li>
  </ul></li>
  <li>Machine B, VxWorks, one NIC:
  
  <ul>
  <li>NIC #1 (int network):  192.168.32.16/26 (DHCP, assigned by Machine A)</li>
  </ul></li>
  </ul>