With the availability of Microsoft’s Forefront Threat Management Gateway (TMG) 2010 on MSDN and as a free trial download from TechNet, I decided it was finally time to install the RTM version and add a TMG post to the ISA & TMG collection here on RetroHack. In this two part post, we will go over the basic installation of the product, with the intended uses of both forward and reverse proxy, VPN termination, and a firewall. The server we’ll build during this post will be used again in future posts. The ISA 2006 posts have been some of the most popular on this blog, so I hope that this one meets with your expectations.
The minimum system requirements can be found here but the highlights are as follows.
| Hardware | MSFT Requirements | RetroHack Recommendations |
| CPU | 64-bit, 1.86 GHz, 2 core (1 CPU x dual core) processor. | Two dual core CPUs |
| RAM | 2 GB, 1 GHz RAM. | 4 GB, 1 GHz RAM. |
| Disk | 2.5 GB available space to install TMG, plus room for caching. | A fast RAID 5 array, or better still, a separate disk for caching. |
| NIC | One NIC | Two Gigabit NICs with TOE, but NO TEAMING |
For our install, we’ll start with a Windows 2008 R2 Standard 64bit system, running a single dual-core Athlon processor, with 2GB of RAM and two network cards. One network card will connect to the Internet by way of a TWC Cable bridge. The other will connect to the internal network.
Before beginning with a TMG install, you will want to have your server build complete, with all patches/updates installed, any third party tools you like to have on a standard system, and of course, antivirus. If you plan on the server being a domain member (and you should,) join the domain before you begin. With two NICs, we will need to make sure that the external NIC is configured with our default gateway provided by the ISP, and if you have more than one subnet on the internal network, the internal NIC should have static routes to all internal addresses already configured. If you don’t remember how to do that, here’s the CLI syntax, old school style. Sorry, but I hate netsh.
route add w.x.y.z mask a.b.c.d m.n.o.p –p [enter]
where w.x.y.z is the CIDR network address, a.b.c.d is the subnet mask, and m.n.o.p is the next hop router address.
I can’t stress this enough: get your networking squared away on this machine BEFORE installing TMG!
If you are directly connected to your server, you should be fine, but if you are using RDP, make sure you connect via IP4, and not IP6. The easiest way to do that is to connect using the ip.addr instead of the FQDN. If you don’t, you get something that looks like this.

Yes, that does raise interesting questions about the IPv6 support in TMG, but that is a topic for another post since I really don’t have a clue why this is a problem. Also, we are a long way from being able to RDP to this server from any host, so once you start, stay on this host to the end.
Mounting the DVD launches the TMG Splash page, which is huge. You are going to want to use a display >1024×768 for this. I love my netbook, but a full screen RDP session is not going to cut it on anything with a display smaller than 1368×768.

As you can see, the installation process is neatly divided up into stages.
This section contains links to the deployment guide, and release notes. I don’t really expect you to read the release notes, but you might want to skim the deployment guide for specific scenarios. This post is more for those of you who want to dive in and see how TMG works, to light the fires and kick the tires, so we are going to dive right into…
This section has three parts, and the first should be fast and easy…running Windows Updates. If you started on the left foot, you are already patched. Click it anyway to be sure. Once you have verified you are fully up to date, the real fun begins! Click the “Run Preparation Tool.” This tool adds/enables the necessary roles and features for TMG, namely
- Network Policy Server
- Routing and Remote Access Services
- Active Directory Lightweight Directory Service Tools
- Network Load Balancing Tools
- Windows PowerShell
- Microsoft .NET Framework 3.5 SP1
- Windows Web Services API
- Microsoft Windows Installer 4.5
- Microsoft Chart Controls for Microsoft .NET Framework 3.5 and 3.5 SP1.
Accept the licensing terms, and click next. Then you are prompted to choose whether you are installing the whole shebang, just the management tools (for you to remotely manage from your workstation) or the Enterprise Management Server, which you can use for storing the configuration of and managing arrays. If you read the deployment guide, you might be planning on several servers with different roles. Since we’re just setting up one to take TMG out for a spin, we’re going to stick with the default. 
Click Next to proceed, and the go for coffee. Mmmm, coffee.

It is by caffeine alone I set my mind in motion.
It is by the extract of Coffea canephora that the thoughts acquire speed, the hands acquire shaking, the shaking is a warning.
It is by caffeine alone I set my mind in motion.
Decent hardware will take only a couple of minutes; lesser oomph may take considerably longer. Once it is done, click Finish to launch the Forefront TMG Installation Wizard. We’re now in the third step of the process…the actual install!. The UAC Prompt might be hiding, so if nothing seems to happen, look for the icon flashing down on the task bar.
This might be the first point where you encounter fail. Remember I warned you to use IP4 for RDP? If you didn’t listen, cancel at this point, reconnect using the ip.addr, and the click the “Run Installation Wizard” link on the splash page.
The wizard is pretty standard for MS at first, so click next, accept the licensing agreement, fill in your user information (the MSDN version is pre-pidded,) and then, once again, you must choose.
Again, since we’re installing a single server to test things out, we’ll stick with the default and install Forefront TMG services and Management. Now, on a ‘real’ server with lots of different physical disk, you might choose to install TMG to a directory on a dedicated drive, otherwise leave the default path and click next.
Now we reach the point where thought is required. You must define the internal network.

If you have your networking already setup as suggested earlier, just click Add and select your internal interface. If not, you can define all your networks here, or just pick the internal interface anyway, and we can fix the network assignments later. That won’t be covered in this post however, so if you want to be ready to rock by the end of this article, fix your networking now. It’s okay, I’ll wait right here until you get back.
Ready? Click next, and you will see that TMG, like ISA, is smart enough to create a permit rule so you can continue to connect via RDP. However, if you’re a DHCP client, you will want to finish everything before you disconnect, just in case you get back from the long weekend only to pick up a different lease.

Click your way through and let the installing commence! Again, the time this takes is directly related to hardware, so be patient. More coffee would be a good thing now. Mmmm…coffee. I used to be known as the caffeinated mentat…the more you know.

Now this process will take some time, and you will see the gears spinning if you actually choose to sit and watch, but while Core Components did seem to take about 5 minutes, Additional Components took forever. I really mean it when I say go for coffee.
At some point near the end, as TMG starts services, and if you are using RDP, the progress bar will seem to stop. It hasn’t, you’ve just lost your connection. Disconnect and reconnect and you should see this.

Yay! You may now commence the dance of happiness.

But don’t get too excited…we’ve still got a lot of work to do before we are actually done. Click the checkbox to launch the management console and then click finish.
That will be covered in part two of this post, which I intend to have up in the next 48 hours, and should be available at this link. Check back soon!
You might also enjoy:








{ 18 comments… read them below or add one }
Hi,
Route added the additional subnets i.e
I need to change my TMG2010 Server to a different IP address\ Subnet and support additional subnets being added to the scope of the internal network.
Since changing the address of the internal interface (twice) I have lost the ability to web browse from any subnet or on the TMG and Messaging publishing is not occurring inbound. However I can still can RA to the tmg through both internal \external interfaces. I cannot see any traffic being captured in the log traces.
I used the following approach to change IP addressing and although I no longer get messages reference invalid ranges or IP Spoofing I still cannot operate as expected.
1) Changed internal Interface Address
2) In FW Network objects\computer sets\Array Members\ – changed IP
3) Changed System policies where necessary
4) Added additional Subnets to Network Internal definition
5) Opened up SQL Server Config Manager\ SQL Server Network Config\Protocols for MSFW \ TCPIP\ – properties and change the IP address in IP Address Tab.
6) Did the same as above for ‘Protocols of ISARS’
7) Editing the registry to modify any instance of the following entries associated with the TMG internal interface address – msFPCIPAddress, msFPCName and msFPCIntraArrayAddress
Route –4 – p 192.168.2.0 mask 255.255.255.0 192.168.0.1 Metric 266 IF 10
Any assistance would be most appreciated as I really do not want to have to rebuild it..
Nick
Nick,
If you cannot see any traffic in the logs, my first concern is that the traffic is either not getting to the TMG, or that the network relationships may not be correct. Can you ping the TMG from any internal host? If you haven’t enabled ping, either do so, or stop the firewall service long enough to confirm you have basic layer 3 connectivity to the TMG’s internal interface from your other clients. If you are not configuring clients to use TMG as the proxy, is it a next hop router to the Internet for them? From your route add, you have something at 192.168.2.0/24 and 192.168.0.0/24 that you had to add to TMG’s routing table. But what did you put into the routing table for 192.168.0.1 to identify TMG as the path to the Internet (assuming NAT, not proxy) ?
If you are proxying, and you can ping the TMG, then ensure that the hosts are properly configured to use the TMG as a proxy. If you aren’t my bet is the fix lies in routing properly on 192.168.0.1, whatever that is.
Also, I was good with you on steps 1, 2, 3, 4 and 8, but I have not run into a need to do 5-7. Did you find another post or KB that directed you to do this?
Let me know about that, and whether your clients are supposed to be using the TMG as a proxy, or just as their gateway to the Internet. Also, have you added anything to the TMG, like Web Monitor or other third party plugin?
Ed
Hi Ed,
Ok solved the problem, somehow during the move to a new subnet the default gateway on the external NIC was removed… do not know how that happened, but re-adding and everything worked as expected. Arghhhhh!
With regards to changing the internal NIC IP address, I had some vague errors relating to SQL and as my TMG implementation was using locally installed SQL reporting and DB instance, it made sense to check, and if necessary, change the IP address property of the SQL Server Network Comms. It also really helped that I found the following articles which helped validate this approach.
http://social.technet.microsoft.com/Forums/pl-PL/Forefrontedgegeneral/thread/d1d2df7d-d1d6-4249-91fe-c8136d8487ad
http://www.isaserver.org/tutorials/Microsoft-Forefront-TMG-Storage-101.html
Thanks for your help
Nick
Thanks for the update! Glad you got it all sorted.
Ed
Need help.. how can I go ith this to fix this error
Configuration storage server cannot be installed because port required for installation is currently being used by another service port :2171
Open an administrative cmd prompt.
Enter this command
netstat -ano | findstr 2171That will tell you what the PID is for the process listening on port 2171.
Launch task manager, add the column for PID and sort on it. Find the PID that you got in the netstat command, and then either uninstall or reconfigure that to use an alternate port.
HTH
Ed
Hey!
like your guides you have done about tmg 2010
my problem is i can send out not receive.
i have checked both server there have exchange 2010 hub, cas, mailbox no problem but are something with receive connectors what i can see but how can seeking was is wrong
not sure what is wrong here
Best regards
Bengt Olsson
Bengt
Have you published the mail server protocols (SMTP) yet? Use the firewall console, right click, publish a new mailserver to permit inbound email.
Ed
I work in a school, so have an LA provided Router and Squid Proxy that sits on our LAN and provides us with external connection.
How would TMG integrate into a setup like this? Referring particularly to the 2x NICs. Would we need to configure the TMG “external” card to point at the router. Would our clients then need to have their default gateway address pointing at the “internal” card of the TMG? Will there be any issue with the 2 NICs being on the same subnet?
Will,
What is it you want to do? Define that, and I can answer your questions better, but in short…
Internet-Router-TMGexternal-TMGinternal-internal clients would be one way to do it, but really depends on whether you want to use TMG to reverse proxy (publish) internal resources, or use TMG as a proxy for your clients. If you want to use it as a client proxy, one NIC is fine and configure your clients to use it as a proxy, no need to use as a default gateway.
Two NICs are required for the best security components of TMG, but they must be on different networks so the TMG routes traffic through…on the same subnet there will be no routing.
Of course, if you don’t have admin access to the router/squid, you may be faced with a very difficult task..again, depends on what you are hoping to accomplish.
HTH
Ed
Hi Ed,
Thanks for the reply.
We want to setup TMG more for incoming traffic. We host our own Parental Gateway for access to their child’s data/reports etc. According to the developers of the Parent Gateway (Capita), in order to setup a password challenge and ‘reset via email’ procedure we need to have a ISA or TMG server in place.
Hope that makes sense.
Okay, so you do need to have an interface of the TMG on the “outside” and one on the “inside” to do reverse proxy (secure web publishing.)
If your existing router only gives you one publicly routable IP you may have to redo your network so that your TMG is the default gateway on the inside, and has the one public ip.addr on the outside, but from traceroutes to you, it looks like you are on a small subnet, therefore…
Router->TMG external in DMZ->TMG internal in Internal->inside Parental Gateway
Router will forward all necessary traffic (assume TCP 80 and 443) to the ip.addr on the TMG external.
You’ll publish using a listener on the TMG, and make all requests appear to come from the TMG so responses from the Parental Gateway route back properly.
Good info, cheers mate.
Problem being is that our LAN is part of a Local Authority WAN and they have the public IPs on their routers. We just connect to their network from our router and they manage our connectivity to the outside world.
Thanks for your help, it’s much appreciated
hi,
im not able to selelct Forefront TMG services and Management. i can only select forefront TMG management only. pls give me any resolution for how do i resolve it. im installing it on domain server and it is having active directory.
both first and third option are frozen in prepairation tool.
Sounds to me like you are either trying to install on a workstation, or you are missing prerequisites. Did you run Windows Update and then Preparation Tool? What operating system are you using?
i m installing it on windows server 2008 r2 64 bit version. and it is domail controller to….
Ah, you cannot install TMG on a DC.