Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have deployed a wpad.dat. Works like a charm except for some users that are connected to two networks at the same time (ethernet and another networkadapter that emulates an analog modem for fax). I also tested this with my notebook. When I connect to the LAN through cable and at the same time to another network through WiFi, I do not get a connection to the internet. When I provide the proxy address directly, it works.

How do I have to change my script, in order to solve my problem?

function FindProxyForURL(url, host) {
    if (isInNet(host, "", ""))
    	return "DIRECT";
    if (shExpMatch(url, "*.intranet.*/*"))
    	return "DIRECT";
    if (isInNet(myIpAddress(), "", ""))
    	return "PROXY";
    return "DIRECT";
share|improve this question
What OS and browser? – Jeremy Rossi Aug 14 '09 at 14:45
What version of Windows and browser are your clients? – squillman Aug 14 '09 at 14:45
Windows XP Pro SP3, Internet Explorer 7 – mrt181 Aug 17 '09 at 8:31

@Palmin I had the same problem, and thankfully stumbled upon a solution in this social.technet thread! The priority of adapter IPs that Windows returns to a browser's myIpAddress() implementation can be modified by changing the IP metrics.

I manually set the metrics for my physical adapters to 1, 2, etc, and put the VirtualBox Host-Only Network at the end. It works like a charm now.

My specific configuration/journey for others struggling with the same issue:

  • Windows 7 Enterprise
  • VirtualBox 4.1.20 r80170

Accessing web pages on the Internet when on wireless always failed. When on a wired connection they worked just fine, and intranet pages were always accessible. Disabling the VirtualBox Host-Only Network adapter resolved the issue. Manually configuring my browser to always use a proxy (versus auto-detect) also resolved the issue.

To confirm the nature of the PAC problem, I used the pactester utility to test the behavior of wpad.dat with my physical addresses versus the VirtualBox one. As expected, the proxy script returns direct connections for private IPv4 addresses. The default VirtualBox Host-Only IPv4 address is in the 192.168.x.x range.

Modifying the adapter priority did not resolve the issue for me. It was not fully (and cleanly) resolved until I modified the metrics for each adapter.

share|improve this answer
Credit for this method goes to spike305 in this MSDN thread. I couldn't include it in my original post due to a 2-link per post limit. – Terrance Sep 10 '12 at 13:48
up vote 1 down vote accepted

I have a solution, eureka :)

I had to change the priority of the network interfaces. The interface (LAN) that will have access to the proxy has to be the first interface, if more than one interface is connected to some network.

This lead to my solution:

Paragraph starts with: Credits to Oliver Presland (Microsoft UK) ...

share|improve this answer
Changing the network interface priority does not seem to work on Windows 7 together with Firefox and a proxy.pac file. Even though I have changed the network interface order like described in, myIpAddress() will always return a VMWare adapter. Any ideas? – Palmin Feb 13 '11 at 13:07

This may not work (sorry). The design of PAC was to assume that there was a single, primary interface, and that you could tell it make choices of what proxy on that primary interface should be used.

The most likely cause is that your proxy address is in the address range of the "wrong" interface. You'd have to provide netstat -rn for me to figure that out.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.