Forum Discussion

BPetronio_11363's avatar
BPetronio_11363
Icon for Nimbostratus rankNimbostratus
Apr 06, 2010

Lack of IP, iRule decicion by URL matching

Hello,

 

 

I've no experience in this, but i think it could be easily done.

 

I will have a LC scenario, where in one ISP i will 1 ip address for each content, and in the second ISP, the client is not achieving that goal.

 

 

My client is asking if for one ISP, I could configure the same IP for different contents.

 

 

Imagine, that for one ISP I have:

 

www.cst1.pt with VS 1.1.1.1 (80) – Pool Member (192.168.1.1:80)

 

www.cst2.pt with VS 1.1.1.2 (80) – Pool Member (192.168.1.2:80)

 

 

As the client has not 2 ip public address for both content on ISP2, can i do the following ?:

 

www.cst1.pt with VS 2.2.2.1 (80) – ( Redirecting client for a different IP Port (2.2.2.1:100) (new VS) based on URL ) - Pool Member (192.168.1.1:80)

 

www.cst2.pt with VS 2.2.2.1 (80) – ( Redirecting client for a different IP Port (2.2.2.1:200) (new VS) based on URL ) - Pool Member (192.168.1.2:80)

 

 

Here, we are falling in 2 questions:

 

 

- 1st, the Link Controller, given back the IP address for a certain name resolution.

 

- 2nd, the VS with some kind of iRule, matching a given URL for making decision on each PoolMember or different VS (if redirecting) it will hit.

 

 

The client is making this question, not only for 1 or 2 contents, but for almost 40 content.

 

 

Is it possible?

 

Can someone more experience give me some lights on iRule, if it possible of it ?

 

 

Best Regards,

 

Bruno Petrónio

2 Replies

  • Hi Bruno,

     

     

    I don't think you can use an iRule on LC to look at the HTTP headers (including the requested host header) and select a pool accordingly. This would be simple to do in an iRule on LTM.

     

     

    Do you have an option for HTTP classes in the LC GUI? If so, you could do this by configuring the host and/or URI in two HTTP classes and then add them to the virtual server.

     

     

    Aaron
  • Thank you Aaron,

     

     

    In fact, i have LC and LTM licence.

     

    LC for response to DNS Server Queries, where i will have several names resolved for different Virtual Servers with the same IP, but different Ports.

     

     

    The iRule i was talking about, was for LTM.

     

     

    What i am trying to do, is making a VS for connections on port 80, other for connections on port 443, other for 25, etc.. etc...

     

    In each VS, i will apply an iRule for filtering the url on the header, and apply the respectivly pool for each url.

     

     

    Example:

     

     

    Pool1 : 192.168.1.1:80

     

    Pool2 : 192.168.1.2:80

     

    VS: 2.2.2.1:80 with the iRule:

     

     

     

    when HTTP_REQUEST {

     

    if {[HTTP::uri] equals {www.cst1.pt}} {pool pool1}

     

    else

     

    if {[HTTP::uri] equals {www.cst2.pt}} {pool pool2}

     

    else

     

    if .... "and so on... and so on"

     

    }

     

     

    Thank you a lot