Forum Discussion

Mohammed_Moin_2's avatar
Mohammed_Moin_2
Icon for Nimbostratus rankNimbostratus
Oct 21, 2018

Redirect traffic upon source data group

Hi All, I need to redirect the traffic to specific pool based upon the data group.

 

If traffic source from DG private-IP then forward to POOL Server-POOL_DC1 if traffic source from else then forward to POOL Server-POOL_DC2

 

I wrote the below irule, but while saving it get error message of missing brackets;

 

when HTTP_REQUEST { if {[class match [IP::client_addr] equals private-IP} { Pool Server-POOL_DC1 } else { Pool Server-POOL_DC2 } }

 

Kindly plz let me know where my irule is going wrong and what is missing. Thanks

 

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    Try below

    when HTTP_REQUEST {
    if { ([class match [IP::client_addr] eq private-IP])} {
        pool Server-POOL_DC1
    } else {
        Pool Server-POOL_DC2
    }
    }
    
  • pool command must be lowercase

    when HTTP_REQUEST {
    if { ([class match [IP::client_addr] eq private-IP])} {
        pool Server-POOL_DC1
    } else {
        pool Server-POOL_DC2
    }
    }