Forum Discussion
**** Mult-Pool Load Balancing based on Destination TCP port ****
If anyone can give me a bit of direction here I would be much obliged.
thx,
Ryan
****************************************
when CLIENT_ACCEPTED {
switch [TCP::local_port clientside] {
"7300" { pool test_pool1 }
"7310" { pool test_pool2 }
"7320" { pool test_pool3 }
"7330" { pool test_pool4 }
"7340" { pool test_pool5 }
"7350" { pool test_pool6 }
"*" { pool test_pool_any }
}
}
****************************************
- The_Bhattman
Nimbostratus
You can add some logging statements to see what is being applied - Ryan_Primavera_
Nimbostratus
this is what I get back in the log when I add that in: - The_Bhattman
Nimbostratus
Oops. I forgot that your event was client accepted - Ryan_Primavera_
Nimbostratus
Below basically is the functionality I am looking for. If there is a better way to skin the cat here I am all for it. - Ryan_Primavera_
Nimbostratus
- The_Bhattman
Nimbostratus
How about you rewrite it in the following mannerwhen CLIENT_ACCEPTED { switch [TCP::local_port clientside] { "7300" { pool test_pool1 } "7310" { pool test_pool2 } "7320" { pool test_pool3 } "7330" { pool test_pool4 } "7340" { pool test_pool5 } "7350" { pool test_pool6 } default { pool test_pool_any } } }
- hoolio
Cirrostratus
[TCP::local_port] in any clientside event (like CLIENT_ACCEPTED) is already run in the clientside context, so you don't need to to use the clientside keyword. - Viv_Richards
Cirrostratus
As per my requirement ,I have tried and it is working.
VS has been configured for all port (*) and for each local_port, traffic is destined to specific pool
=============================
when CLIENT_ACCEPTED {
switch [TCP::local_port clientside] {
"2181" {
pool pool_abcd_2181
log local0. "abcd port 2181 is:[TCP::local_port]"
}
"2182" {
pool pool_abcd_2182
log local0. "abcd port 2182 is:[TCP::local_port]"
}
"2183" {
pool pool_abcd_2183
log local0. "abcd port 2183 is:[TCP::local_port]"
}
"5051" {
pool pool_abcd_5051
log local0. "abcd port 5051 is:[TCP::local_port]"
}
"6051" {
pool pool_abcd_6051
log local0. "abcd port 6051 is:[TCP::local_port]"
}
"7051" {
pool pool_abcd_7051
log local0. "abcd port 7051 is:[TCP::local_port]"
}
"8051" {
pool pool_abcd_8051
log local0. "abcd port 8051 is:[TCP::local_port]"
}
"9051" {
pool pool_abcd_9051
log local0. "abcd port 9051 is:[TCP::local_port]"
}
"9092" {
pool pool_abcd_9092
log local0. "abcd port 9092 is:[TCP::local_port]"
}
"9093" {
pool pool_abcd_9093
log local0. "abcd port 9093 is:[TCP::local_port]"
}
"9094" {
pool pool_abcd_9094
log local0. "abcd port 9094 is:[TCP::local_port]"
}
"9095" {
pool pool_abcd_9095
log local0. "abcd port 9095 is:[TCP::local_port]"
}
default {
reject
log local0. "abcd port denied is:[TCP::local_port]"
}
}
}
==========================
Hope it will be helpful
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com