cancel
Showing results for 
Search instead for 
Did you mean: 

isInNet(myIpAddress() not working properly

We will implement network changes in the near future and while we're in between installs we need to modify the proxy file, for clients in certain subnets to go direct, and the rest go through the proxy. In the meantime I'm testing with my machine, but the results are unpredictable. This is my file:

 

function FindProxyForURL(url, host) {
    if (isInNet(dnsResolve(host), "172.20.0.0", "255.255.0.0") ||
    isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
    isInNet(myIpAddress(), "172.20.36.147", 255.255.255.255)) 
 return "DIRECT";

    return "PROXY X.X.X.X:9090";
}

The part that is not working is

isInNet(myIpAddress(), "172.20.36.147", 255.255.255.255

I am testing with my own IP, if I apply this file to a different system in the same subnet, but different IP, it also sends the traffic direct.

Does this function work with /24 subnet ranges only? Are there any known limitations.

What could be a different way to achieve the same result.

Thank you in advance,

Erga

3 Replies

Re: isInNet(myIpAddress() not working properly

I did find a typo in my proxy file, the correct line now is:

isInNet(myIpAddress(), "172.20.36.147", "255.255.255.255")

Still is not working. I tried to replace the subnet mask with a CIDR notation, no luck.

 

McAfee Employee jscholte
McAfee Employee
Report Inappropriate Content
Message 3 of 4

Re: isInNet(myIpAddress() not working properly

This discussion is a really good read relevent to what you're seeing:

https://community.mcafee.com/t5/Web-Gateway/PAC-Client-IP-Load-Balancing-myipaddress-inconsistencies...

McAfee Employee jscholte
McAfee Employee
Report Inappropriate Content
Message 4 of 4

Re: isInNet(myIpAddress() not working properly

I say its relevent because you're using the myIpAddress function which can be unreliable. You may gleen other info from that discussion though.

More McAfee Tools to Help You
  • Subscription Service Notification (SNS)
  • How-to: Endpoint Removal Tool
  • Support: Endpoint Security
  • eSupport: Policy Orchestrator