-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathsource-ip-lb.tcl
More file actions
34 lines (32 loc) · 859 Bytes
/
source-ip-lb.tcl
File metadata and controls
34 lines (32 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
# Copyright 2014, Mischa Peters <mpeters AT a10networks DOT com>, A10 Networks.
# Version 1.0 - 20131003
#
# 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-adfs-ips" (default) and has
# to contain the following data:
# <ip> /<netmask>
#
# For example:
# 10.110.102.0 /24
# 172.30.0.0 /22
#
# Scalability of this aFleX is unknown.
#
when RULE_INIT {
set ::DEBUG 0
set ::CLASSLIST "cl-adfs-ips"
}
when CLIENT_ACCEPTED {
if { [CLASS::match [IP::client_addr] $::CLASSLIST ip] } {
if { $::DEBUG == 1 } { log "CLASS::match on [IP::client_addr]" }
pool sg-adfs
} else {
if { $::DEBUG == 1 } { log "IP [IP::client_addr] not found on class-list" }
pool sg-adfs-proxy
}
}