[Solved]WPAD settings for 2nd Interface



  • Hi!

    My current config is Squid + Squidguard WPAD

    WAN: 192.168.10.5
    LAN: 192.168.0.1/24

    WPAD Settings

    function FindProxyForURL(url, host) 
    {
        if (isPlainHostName(host) ||
            shExpMatch(host, "*.local") ||
            isInNet(dnsResolve(host), "192.168.0.0",  "255.255.255.0"))
            return "DIRECT";
    
        return "PROXY 192.168.0.1:3128";
    }
    

    I am planning to add WLAN Interface and also want to apply wpad settings on wpad

    WLAN: 192.168.1.0/24

    is it possible to configure wpad pointing to 192.168.0.1 and 192.168.1.1?

    Thanks in advance.



  • Try this:

    // If the IP address of the local machine is within a defined
    // subnet, send to a specific proxy.
        if (isInNet(myIpAddress(), "192.168.1.0", "255.255.255.0"))
            return "PROXY 192.168.1.1:3128";
    
        if (isInNet(myIpAddress(), "192.168.0.0", "255.255.255.0"))
            return "PROXY 192.168.0.1:3128";
    


  • thanks -flo- it worked.  :)