1

I have a requirement in F5 where i have to configure multiple pools and all pools will be using Single virtual server [1 VIP] to receive traffic from outside world. I am trying to figure out any specific configuration is required which i am missing to achieved this goal. As of now my F5 config is working when i assign default pool to virtual server , since i have to use 1 VIP with multiple clients hosted on it so i am stuck at this point. can someone help me here.

Abhishek
  • 121
  • 5

3 Answers3

1

Dexirian is correct above - but I think this more correctly answers based on your need for multiple pools due to multiple clients:

when HTTP_REQUEST {
    switch -glob [string tolower [HTTP::uri]] {
        "/123*" { 
            HTTP::uri "/"
            pool pool_123 
        }
        "/456*" { 
            HTTP::uri "/"
            pool pool_456 
        }
        "/789*" { 
            HTTP::uri "/"
            pool pool_789 
        }
    }
}
JStryker
  • 46
  • 1
0

You're going to need to use iRules in order to have multiple pools on a single VIP. See relevant documentation here

The thing you have to think about now is how to select which pool to use. You could check the host or URI values as follow :

when HTTP_REQUEST {
  if { [HTTP::uri] contains "blabla"} {
    pool "Your pool name here"
 }
}

Please let me know if you need more information, am quite familiar with F5 iRules ;)

Dexirian
  • 430
  • 2
  • 11
  • irule is one solution to it agreed. This will create problem in near future when we create 100s of pools and every time we have to update irule. I have used host based irule to route the traffic , any idea if we can write common irule across the platform to serve the purpose or any specific config we can do to achieve this. – Abhishek Jan 28 '20 at 08:51
0

Assuming you are switching pool by application name (read: fqdn) then you could name your pools appropriately and the iRule could be generic:

when HTTP_REQUEST {
  if { [catch {pool [HTTP::host]}] } {
    log local0. "error - pool [HTTP::host] does not exist"
    # Set pool to default since HTTP::host did not match existing pool
    pool [LB::server pool]
  }
}
Jason Rahm
  • 396
  • 1
  • 6