Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

iRule point to a different VS when HTTP_Request matches

Hi All,

At this moment we have an rule as following:

when HTTP_REQUEST {
 if { ([HTTP::uri] starts_with "/corporate/" ) && ( [active_members [LB::server pool]] > 0)}  {
        persist none
        pool POOL.corporate.nl.prod

# If the POOL.tui.nl.prod is "down" the client will be send to the "POOL.PrimarySorryFarm" pool             
} elseif { ([HTTP::uri] starts_with "/corporate/" ) && ( [active_members [LB::server pool]] < 1)}  {
        persist none
        pool POOL.PrimarySorryFarm
        log local0. "Client [IP::client_addr]:[TCP::client_port] -corporate Redirect naar sorry pool!"

}  else {
        persist source_addr 255.255.255.255 1800
        pool POOL.arke.nl.prod

But now we want to not point that traffic to a pool but to a different server because for that http_request we need to SNAT the traffic.

In the documentation of HTTP_REQUEST I only see options to point it to a pool or node and not to an other vs.

Any suggestions?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

instead of pool just use virtual:

if { ([HTTP::uri] starts_with "/corporate/" ) && ( [active_members [LB::server pool]] > 0)}  {
    persist none
    virtual virtualname
    }
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Ronald,

If your only issue is that you need SNAT enabled on certain URI paths, you could use the 'snat' command as shown below:

 if { ([HTTP::uri] starts_with "/corporate/" ) && ( [active_members [LB::server pool]] > 0)}  {
        persist none
        pool POOL.corporate.nl.prod
        snat automap
}

The 'snat' command can utilize SNAT automap, SNAT pools, and can also SNAT to any address specified in the iRule.

Hope this helps.

0