Forum Discussion
wpduhe_174647
Nimbostratus
Oct 20, 201410.2.4 LB::reselect doesn't seem to work
I have the below iRule that will change the destination port to a specific node in a pool. The log messages show up in the /var/log/ltm file indicating that the "if" statement works and the variable...
nitass
Employee
Oct 21, 2014can you try something like this?
configuration
root@ve10(Active)(tmos) list ltm virtual bar
ltm virtual bar {
destination 172.28.24.9:any
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
tcp { }
}
rules {
qux
}
snat automap
}
root@ve10(Active)(tmos) list ltm pool foo
ltm pool foo {
members {
200.200.200.101:any { }
200.200.200.111:any { }
}
}
root@ve10(Active)(tmos) list ltm rule qux
ltm rule qux {
when CLIENT_ACCEPTED {
set pick [LB::select]
log local0. "pick=$pick"
set ip [lindex [split $pick " "] 3]
log local0. "ip=$ip"
switch $ip {
200.200.200.101 {
node $ip [TCP::local_port]
}
200.200.200.111 {
node $ip [expr {[TCP::local_port] + 1}]
}
default {
do something
}
}
}
when SERVER_CONNECTED {
log local0. "client=[IP::client_addr]:[TCP::client_port] \
virtual=[clientside {IP::local_addr}]:[clientside {TCP::local_port}] \
server=[IP::server_addr]:[TCP::server_port]"
}
}
/var/log/ltm
[root@ve10:Active] config tail -f /var/log/ltm
Oct 21 22:20:16 local/tmm info tmm[4955]: Rule qux : pick=pool foo member 200.200.200.111 0
Oct 21 22:20:16 local/tmm info tmm[4955]: Rule qux : ip=200.200.200.111
Oct 21 22:20:16 local/tmm info tmm[4955]: Rule qux : client=172.28.24.1:32828 virtual=172.28.24.9:80 server=200.200.200.111:81
Oct 21 22:20:38 local/tmm info tmm[4955]: Rule qux : pick=pool foo member 200.200.200.101 0
Oct 21 22:20:38 local/tmm info tmm[4955]: Rule qux : ip=200.200.200.101
Oct 21 22:20:38 local/tmm info tmm[4955]: Rule qux : client=172.28.24.1:32829 virtual=172.28.24.9:80 server=200.200.200.101:80
- wpduhe_174647Oct 21, 2014
Nimbostratus
Thanks nitass!!! This works perfectly.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
