TMG proxy issue

Hi Experts-

We are having a problem regarding TMG proxy wpad.dat issue....

Every now and then (no particullar pattern) browsers are trying to connect to proxy using TMG RRAS ip addresses and then being blocked.

Opening a new browser window will use correct fqdn for TMG and internet access i OK.

We have run the  CarpNameSystem.js on TMG server.

Any ideas why this happens on and off?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dhanesh KansariSenior IT ManagerCommented:
Hi There,

cscript carpnamesystem.js /set:DNS

It sets proxy address in the wpad.dat to FQDN instead of IP (which in our case is a RRAS one). you can get code of this file from link given below.
jakobmarkussenAuthor Commented:
Hi. Thanks - didn't make it clear: That has been done.
If I run it again I just get a "nothing to correct" message.

I also tried running del /wpad*.dat /s on clients - that doesn't help.
Dhanesh KansariSenior IT ManagerCommented:
Hi There,

When you set up the internal network, did you enter the IP addresses in manually or did you use the "add adapter" button?

What is your network topology on the TMG 2010 server, Single Network Adapter or Edge Firewall?  

What IP address and subnet mask are on the external network?
Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

Dhanesh KansariSenior IT ManagerCommented:
jakobmarkussenAuthor Commented:
I will look at the link thanks.

Internal network I added adapter
It's Edge firewall
External adaptor has a couple of Public IP's
How is the wpad entry in the dns defined? Is it a CNAME or is it an A record. It could be possible that TMG would register its RRAS Ip's with the DNS...
jakobmarkussenAuthor Commented:
I haven't a wpad dns entry.. Using DHCP.
Also no RRAS Ip's are in DNS.
jakobmarkussenAuthor Commented:
Ok - found that in Routing and remote Access the DHCP Relay Agent has the IP address that is given to the wpad clients. how can we 'stop' this ? thx
Remove it from the Scope options on the DHCP server for that network.

But if I were you, I would investigate why it was there in the first place.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jakobmarkussenAuthor Commented:
Not sure what to remove.. Sorry...

The TMG was setup like this at some point:

When using the internal dhcp for vpn clients - I will need relay agent, right?

Go to the DHCP console, find the RRAS network, expand it, click on "Scope Options"

Find the 252 Option - WPad, then modify it or remove it. on the right screen.

New clients in that network will not get the WPAD IP.

Also make sure, that you consider possible consequences before performing this..
jakobmarkussenAuthor Commented:
We might need a major clean up ;)

We do not have a dedicated RRAS network - RRAS is using the interal adapter on TMG so also using the same scope as internal ...

Perhaps we would be better of using dns for auto disc?
Only thing here is that we have more sites with seperates TMG's sharing DNS ... So we would need to figure out how to force clients on each site to use correct TMG /wpad setting...
jakobmarkussenAuthor Commented:
Okay - I removed 252 option from DHCP- fwctool testautodetect no longer find wpad in DHCP.
I set up DNS instead. Thing was fine for an hpur or two.. Now I once againt get the same error.
Any idead why this is happing when using DNS to distr. autodiscover settings?
Does this happen on all machines, or just a set of machines?

What is the exact symptom, Are you using a Load Balanced TMG - Enterprise?
jakobmarkussenAuthor Commented:
At the moment just 2 machines. One Windows 7 and one XP. I worried that more machines might start to fail.

The thing starts suddenly. Internet browsing might be fine for hours, then suddenly we get this error that TMG denies connection. We see that it replies on rras relay agent IP.
Opening a new browser window and it works again.

Not load Balanced - and Standard TMG
If you monitoring the TMG traffic to and from that client, what do you see in that interval?
TMG console , Logs and reports, logging - check the traffic in the last hour ..
jakobmarkussenAuthor Commented:
I will setup logging for one of the machines tomorrow morning to se what happens around failure.. thx

I have attached a rras info on TMG.
Perhaps the issue make more sence then?
jakobmarkussenAuthor Commented:
So it just happened.
Was browsing normally untill suddenly TMG denied access:

Technical Information (for support personnel)
Error Code: 403 Forbidden. Forefront TMG denied the specified Uniform Resource Locator (URL). (12202)
IP Address:
Date: 4/24/2012 6:32:41 AM [GMT]
Server: xx.yy.zzz
Source: proxy

Where is rras ip ...

TMG log show nothing - normal traffic to TMG server IP - then it starts trying to use as proxy out of nowhere.
What is in your WPAD entry for DNS? Hostname or IP?
jakobmarkussenAuthor Commented:
It was Hostname - I have changed to IP - will check if that changes anything
jakobmarkussenAuthor Commented:
Changing it to IP causes autodetect to fail...
You changed to one of TMGs IPs?

It doesn't really make sense it would fail, because the hostname points to the same IP?

Do the clients receive the Wpad.dat file from the TMG?

You can check this by entering, where is the IP you changed it to.

And then monitor this from the TMG console.

Also if you do a Nslookup in your environment, how does it resolve this hostname?
jakobmarkussenAuthor Commented:
Yes the clients recieve wpad from TMG.
I tried to change to IP number instead of fqdn .. Let's see if that is changing anything.

Thanks so far
jakobmarkussenAuthor Commented:
Lasted almost 24h. This morning wpad IP changed again for the affected clients.
This is driving me crazy :)
jakobmarkussenAuthor Commented:
Restartet computer and the problem returned.
If I open another IE windows wpad is fine.
The IE window with "the wrong wpad IP" is still not getting the right IP..

nslookup is fine..

This may be a long shot, but can you try opening the wpad.dat that you download from a browser and check whether this IP is referenced in it?

Do the problematic clients have any entries in their hosts file?
jakobmarkussenAuthor Commented:
Hi Simon - been on vacation so haven't been able to update this untill now.
The last 2 days no clients have failed.
I'll accept your answers as solutions - but can't tell what did the trick.
Thanks for helping out - will "re-open" if the problem returns.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Forefront ISA Server

From novice to tech pro — start learning today.