Options

Source IP Load Balancing w/ class-list

mischamischa Member
################################################# # # aFleX script to provide Source IP load balancing # decision for a service-group. # (Currently this is not supported with bw-list in ADP) # # The class-list for the IP list is called # "cl-ips" (default) and has # to contain the following data: # / # # For example: # 10.10.10.0 /24 # 172.16.0.0 /16 # ################################################# when RULE_INIT { set ::DEBUG 0 set ::IPLIST "cl-ips" } when CLIENT_ACCEPTED { if { [CLASS::match [IP::client_addr] $::IPLIST ip] } { if { $::DEBUG == 1 } { log "CLASS::match on [IP::client_addr]" } pool sg-internal } else { if { $::DEBUG == 1 } { log "IP [IP::client_addr] not found on class-list" } pool sg-others } }

Comments

  • Options
    mischamischa Member
    edited February 2014
    File attached.
  • Options
    max.aquinomax.aquino Member
    edited October 2015
    Hi,

    I'm using this script:

    when RULE_INIT {
    set ::DEBUG 0
    set ::IPLIST1 "CLserver1"
    set ::IPLIST2 "CLserver2"
    }

    when CLIENT_ACCEPTED {
    if { [CLASS::match [IP::client_addr] $::IPLIST1 ip] } {
    if { $::DEBUG == 1 } { log "CLASS::match on [IP::client_addr]" }
    pool Grupo_server1} else {
    if { [CLASS::match [IP::client_addr] $::IPLIST2 ip] } {
    if { $::DEBUG == 1 } { log "CLASS::match on [IP::client_addr]" }
    pool Grupo_server2}
    }
    }

    CLserver1 contents the addresses:
    172.18.10.x
    10.200.72.x

    CLserver2 has no IP address… once I change those IPs address to CLserver2 instead of CLserver1, I can’t see any change… It's needed to reload the TH to see the changes work.

    Is there a way to avoid reloading?
  • Options
    dshindshin Member
    edited October 2015
    Provide a build number and perhaps I can replicate the problem.

    Genard
Sign In or Register to comment.