Forum Discussion
Paul_Slosberg_8
May 17, 2007Historic F5 Account
A better way
Greetings,
Im trying to grab the last octect of the client adress so I can then use that to send the thraffic to the proper pool. I will have 254 pools that I need to send traffic too. Im trying t...
May 21, 2007
Ok, I might have something for you. You can specify the node you are connecting to with the node command.
You could do this in the CLIENT_ACCEPTED event but then you would have to know the address of the node you want to connect to. But, if you wait until a LB decision has been made, you can get the targeted pool member, override the target with the same member but a different port.
Here's something that might just work for a general case (be warned, I haven't fully tested it out).
when LB_SELECTED {
set server [LB::server]
log local0. "Server: $server"
set list [split $server " "]
set member [lindex $list 1]
log local0. "Node: $member"
set port 4[format "%.3d" [getfield [IP::client_addr] "." 4]]
log local0. "Port: $port"
switch [llength $list] {
"3" {
log local0. "First pass server format 'pool member port'"
node $member $port
must call LB::reselect to trigger a new lb decision
based on the previous node command
LB::reselect
}
}
}The LB::reselect with trigger a second LB_SELECTED event with the value of "LB::server" being just the member and port (as opposed to in the first pass where it's the pool, member and port.
Now, if you know the address of your node that you are connecting to, then it's really easy as you can issue the node command from the CLIENT_ACCEPTED event.
when CLIENT_ACCEPTED {
node 10.10.10.10 4[format "%.3d" [getfield [IP::client_addr] "." 4]]
}where 10.10.10.10 is the address of your node.
Just something completely off the top of my head but worth a shot. Let me know if any of this works out...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
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