Proxy autoconfiguration with WPAD.dat and multiple network adapters

If you use a proxy server in your company, you would like to automatically configure your clients using a WPAD.dat-file. If you use the myIpAddress()-function, this function will returns the ip address from one active network adapter, maybe from the wrong one. This function couldn’t determine, which network adapter would made the connection to your proxy server. In this case you couldn’t connect to the internet, cause the WPAD.dat file returns the wrong result.

There is no automatic metric inside the WPAD.dat to detect, which adapter is the active adapter, nearest to your proxy server. You need to set the ip metric manualy on each network adapter:

Go to your network settings:

right click your prefered network adapter and select Properties:

Select IPv4 and click to Properties:

Click to Advanced

Disable the checkbox near to Automatic metric and set in the field Interface metric a value of 1.

Repeat this steps through all your nic’s, by incrementing the last value for prioritize your connections.