Forum Discussion

DanS's avatar
DanS
Icon for Nimbostratus rankNimbostratus
Jan 16, 2020

Using an iRule to add source address affinity persistence.

Hello, i'm trying to figure out if there is a way to add a persistence profile (60 minute source address affinity) only to the pool members in the below irule. Basically we're doing hostname mapping via irule and only need a 60 minute persistence profile on the 3xxx pools. Any help would me much appreciated. Thanks!

 

when HTTP_REQUEST {

      if {[string tolower [HTTP::host]] equals "example.100.f5.com"} {

        node 10.10.10.77:44351

    }

      elseif {[string tolower [HTTP::host]] equals "example.200.f5.com"} {

        node 10.10.10.77:44358

    }

      elseif {[string tolower [HTTP::host]] equals "example.300.f5.com"} {

        node 10.10.10.77:44359

    }

      elseif {[string tolower [HTTP::host]] equals "example.400.f5.com"} {

          pool Treas_CRM-UAT_3259_Pool <-- need 60 minute source address affinity profile

    }

  elseif {[string tolower [HTTP::host]] equals "example.500.f5.com"} {

          pool Treas_ECC-UAT_3251_Pool <-- need 60 minute source address affinity profile

    }

      elseif {[string tolower [HTTP::host]] equals "example.600.f5.com"} {

          pool Treas_BW-UAT_3258_Pool <-- need 60 minute source address affinity profile

    }

      else { discard }

}

 

3 Replies

  • DanS's avatar
    DanS
    Icon for Nimbostratus rankNimbostratus

    So something like this? Please see below. thanks!

     

    when HTTP_REQUEST {

          if {[string tolower [HTTP::host]] equals "example.100.f5.com"} {

            node 10.10.10.77:44351

        }

          elseif {[string tolower [HTTP::host]] equals "example.200.f5.com"} {

            node 10.10.10.77:44358

        }

          elseif {[string tolower [HTTP::host]] equals "example.300.f5.com"} {

            node 10.10.10.77:44359

        }

          elseif {[string tolower [HTTP::host]] equals "example.400.f5.com"} {

              pool Treas_CRM-UAT_3259_Pool <-- need 60 minute source address affinity profile

    persist source_addr 255.255.255.255 3600

        }

      elseif {[string tolower [HTTP::host]] equals "example.500.f5.com"} {

              pool Treas_ECC-UAT_3251_Pool <-- need 60 minute source address affinity profile

    persist source_addr 255.255.255.255 3600

        }

          elseif {[string tolower [HTTP::host]] equals "example.600.f5.com"} {

              pool Treas_BW-UAT_3258_Pool <-- need 60 minute source address affinity profile

    persist source_addr 255.255.255.255 3600

        }

          else { discard }

    }