vADC Forum

Reply
Occasional Contributor
Posts: 6
Registered: ‎01-16-2014
Accepted Solution

TrafficScript that uses Traffic IP as the variable

We currently have a web application in our environment that we wish to have a single pool of servers for, with separate TIP's for Internal and External users. 

We want the users who hit the internal TIP to be directed to

app1.xyz.com/passthroughauthentication.htm

We want users that hit the external TIP to go to

app1.zyx.com/formsbasedauthentication.htm

I am unable to see a way to do a IF/Then with traffic script that uses the Traffic IP as the qualifier, any ideas?

New Contributor
Posts: 2
Registered: ‎11-20-2013

Re: TrafficScript that uses Traffic IP as the variable

Depends on how your client handles a HTTP redirect.

One way would to be bind each Traffic IP to its own Virtual Server, then use a trafficscript as appropriate on each VS ie, for the internal one:


http.redirect( "http://app1.xyz.com/passthroughauthentication.htm" );


If you don't like the idea of using two Virtual Servers you could look at string.ipmaskmatch - ie, check wether the source IP address is in a private address space. Only works if your 'internal' clients use private addresses.

There are other things you can do, such as have pools for specific nodes which only handle specific types of authentication and switch between the pools as required depending on the source - a bit more involved to set up though.

Contributor
Posts: 58
Registered: ‎11-29-2012

Re: TrafficScript that uses Traffic IP as the variable

See the request.getLocalIP() function, Returns the IP address that the client connected to, i.e. the address local to this machine.


if( request.getLocalIP() == "10.0.0.1" ){


   http.redirect( "app1.xyz.com/passthroughauthentication.htm" );


}


   else {


   http.redirect( "app1.zyx.com/formsbasedauthentication.htm" );


}



Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.