Forum Discussion

tech_cbre_90864's avatar
tech_cbre_90864
Icon for Nimbostratus rankNimbostratus
Oct 11, 2011

iRule for redirecting to correct Pool or server

I am a little new to the iRule world but i am catching up fast. Here is a brief explanation .

 

 

I have 2 URLs or external hosts ( Mailxyz.domain.com and mobilexyz.domain.com ) both of them pointing to the Same External IP Address , let's say 200.100.100.100 . This 2 URLs are being accessed by a lot of the old Mobile devices for mail purpose on EXCHANGE 2003 Server

 

 

Note: Not exchange 2010 , it is Exchange 2003

 

 

i.e

 

 

mailxyz.domain.com -->Ext IP: 200.100.100.100 --> FW NAT --> F5 --> 10.10.10.10

 

mobilexyz.domain.com -->Ext IP: 200.100.100.100 --> FW NAT --> F5 --> 10.10.10.10

 

 

All clients traffic are using port 443 ( https ) to both URLs.

 

 

external traffic using URL mailxyz.domain.com are ActiveSync, OWA & RPC over Https

 

and

 

 

external traffic using URL mobilexyz.domain.com are ActiveSync & RPC over Https but not OWA

 

 

We recently added another server to handle new mobile devices and start migrating those old mobile devices to the new infrastructure or server.

 

 

Newmobilexyz.domain.com -->Ext IP: 200.100.100.200 --> FW NAT --> F5 --> 10.10.10.20

 

 

PROBLEM:

 

 

The traffic from the old Devices pointing to both 2 old URLs ( mailxyz.domain.com & mobilexyz.domain.com ) need to be split such that All ACTIVESYNC traffic on Port 443 ( https) is redirected by F5 to the new mobile devices server ( Newmobilexyz.domain.com ) . While the rest of the traffic still goes to the ( mailxyz.domain.com & mobilexyz.domain.com )

 

 

 

How can i achieve this ? i have looked into Separate VIPs, Cookie , Http Header & irules . What is the simplest way to resolve this using irules
  • Hi tech_cbre,

    The hardest part of what you are trying to do is determine which traffic to route. You could use the User Agent of the devices (the old devices as you put it) to make the determination which devices need to be redirected to the new URL.

    Something like this will allow you to handle the User Agents that need to be redirected, or log the unknown User Agents.

     
    when HTTP_REQUEST {
        switch -glob [string tolower [HTTP::header User-Agent]] {
            "*msie*" { do something }
            "*firefox*" { do something }
            "*chrome*" { do something }
            default {
                log local0. "Unhandled User Agent: [HTTP::header User-Agent]"
            }
        }
    }
    

    Hope this helps.