title: How to specify a specific NIC to be used in an application written in c++ (boost asio)
body: <p>I have a machine connected to multiple independent networks, each on a different NIC (Network Interface Card). The machine runs Windows 7. </p>
  
  <p>I run an application on the machine which needs to connect to a specific IP through a specific NIC, using TCP. The application uses c++11 and boost asio (1.53.0) for networking, and the source can be changed.</p>
  
  <p>What are the different reasonable ways to solve this problem (specify endpoint IP and NIC) in a Windows environment? </p>
  
  <p>The current solution assigns the respective (blocks of) IPs to the right NIC in the the routing table - by using the command line "route" command - as persistent routes. That way the OS handles the problem, which is allowed but not required.</p>