One of my applications acts as a TCP/IP server for an external laboratory instrument. In one of my customers, this instrument is directly connected to the PC running my app using a USB to Ethernet dongle.
The problem is that my application is binding to the default ethernet adapter which is a WIFI card.
It took me a while to find out how to change the order of the ethernet adapters. If you do a quick google search http://support.microsoft.com/kb/2526067, you’ll find that you have to go to:
View network connections > Advanced settings > Change the binding order
However, this did not work for me. My app was still reporting the IP address of the WIFI adapter, even after a system restart.
Deep in a Microsfot KB support article is the solution. You can change a parameter in the adapter called Interface metric. And that worked! I put 3 on the USB converter and 5 on the WIFI adapter, and voilĂ !
Click Start, click Run, type ncpa.cpl , and then click OK.
The available connections appear in the LAN and High-Speed Internet section of
the Network Connections window.
Right-click the network adapter that you want to change, click Properties, and
then click the General tab.
In the This connection uses the following items box, select Internet Protocol
(TCP/IP). Then, click Properties.
In the Internet Protocol (TCP/IP) Properties dialog box, click the General
tab, and then click Advanced.
On the IP Settings tab, click to clear the Automatic metric check box. Then,
type a value in the Interface metric box.