Wednesday, December 31, 2014

How to Force Sessions through NetScaler Gateway

It always happens. You start a project with a clear direction and wham, you get a curve ball. Something new pops up out of no where and you have to quickly scramble to address this well timed [sarcasm] addition and try to stay on schedule. Better yet, have the schedule already very aggressive based on a customers deadline of which you cannot go past or the gates of hell, otherwise known as the project managers fury come raining down and... OK, I'm being a bit over dramatic, but you get the idea.

The above scenario happened to me (minus the project managers fury) not too long ago during a project that had an unusually  aggressive time line. I had to deploy a full XenApp environment to several hundred users spread across 3 (maybe more) continents. This in itself is not complicated or hard, it was the time line that provided the stress as there was little wiggle room for surprises.

Sure enough, as with most projects, there are surprises. This surprise was a bit more than what I wanted. I discovered, that the VLAN housing the XenApp environment, created by the client, was not accessible by any other location and was not able to be so because of an internal configuration they had. Not only this, they wanted to direct all sessions through NetScaler Gateway on the public side, but keep all the benefits of pass-through authentication, and pretty much everything else that makes sure an shortcut is presented on the users desktop with the published application and all they have to do is launch the shortcut.

My requirements were:

  • Have all sessions directed through NetScaler Gateway on the public Internet.
  • Keep pass-through authentication in place.
  • Have users access a VLAN that they cannot access.
  • Be able to view network metadata in Director per session.
My first thought was how in the world was I going to keep pass-through authentication? I knew that not too long ago NetScaler Gateway does have the ability for pass-through authentication using kerberos. But, because of the time line, we did not have time to deal with that solution. Next, I came across StoreFront optimal gateway feature which fit exactly with what I was trying to accomplish as well as all my requirements could still be kept and it was simple to implement. The work flow for this setup is as follows:


  1. Citrix Receiver launches and contacts StoreFront for single-sign-on.
  2. StoreFront retrieves the published resource list from a Citrix Delivery Controller and forwards this to the endpoint.
  3. Citrix Receiver now sees the published resources available.
  4. The user clicks on the published resource and the application is launched over NetScaler Gateway.
  5. All session traffic runs through NetScaler Gateway.
The StoreFront optimal gateway feature allows the Citrix Reciever to connect to StoreFront and then when the user launches a session, StoreFront directs the session through NetScaler Gateway of your choosing. Pass-through authentication works as you are authenticating against StoreFront and STA's are used when sessions are started through NetScaler Gateway. To combat the problem of users unable to access the XenApp VLAN, all I had to do was move the load balanced virtual server on NetScaler to a VLAN which all users had access. Problem solved, and quickly.

To configure StoreFront optimal gateway:

  1. Get the following information:
    1. The name of the farm as found in the StoreFront "Manage Delivery Controllers" section. Remember that XenApp used to have farms and not sites? Don't confuse this with the site name.
    2. Name of the NetScaler Gateway appliance as found in StoreFront "NetScaler Gateway" settings. I am talking about the logical name, not the URL, so whatever the name column has.
    3. The NetScaler Gateway URL for users to use. To direct users to the public IP, I had the internal DNS A record for the NetScaler Gateway site point to the public IP.
    4. And of course, the STA URLs. I would hope at least two.
  2. You need to modify the web.config file which is by default in C:\inetpub\wwwroot\Citrix\[store]\web.config. Keep in mind it is the store name, not the storeweb directory. Make a backup of the web.config file. Did I mention to make a backup of the web.config file? 
  3. Open the web.config file with a text editor (notepad or whatever) and search for optimalGatewayForFarmsCollection. This is the section you want to modify.
  4. Modify the text below with the information collected found in bold:


Save the file and perform the same steps on any other StoreFront servers you use and you should be set.

This post was written in reference to the following platforms and versions:

  • StoreFront 2.6
  • XenDesktop 7.6
  • NetScaler 10.5 Build 53.9

Sources:

Citrix Systems, Inc.. (Jul 21, 2014). How to Force Connections through NetScaler Gateway Using  Optimal Gateways Feature of StoreFront [Article]. Retreived from http://support.citrix.com/article/CTX200129

No comments:

Post a Comment