Forum Discussion
JRahm
Mar 01, 2005Admin
Terminal Server Persistence
I have msrdp persistence working without a rule, but only within a single vip. Globally, I don't have persistence to the client, so a client could potentially be assigned to the wrong vip, and even t...
unRuleY_95363
Mar 03, 2005Historic F5 Account
Ooops, sorry. I forgot to format the $node variable into an IP address that is compatible with the node command. You should be seeing an error in /var/log/ltm.
So, replace the "set node [ntohl $node]" line with something like:
binary scan [binary format I $node] c1c1c1c1 ip1 ip2 ip3 ip4
set ip1 [expr { ($ip1 + 0x100) % 0x100 }]
set ip2 [expr { ($ip2 + 0x100) % 0x100 }]
set ip3 [expr { ($ip3 + 0x100) % 0x100 }]
set ip4 [expr { ($ip4 + 0x100) % 0x100 }]
set node [format "%u.%u.%u.%u" $ip1 $ip2 $ip3 $ip4]
Of couse, depending on how many different nodes you have, it may be quicker to initialize an array with the integer/ip as name/value pairs.
An example of this approach would look like:
when RULE_INIT {
array set ::my_nodes {
169575472 10.27.132.48
813964042 48.132.27.10
}
}
when CLIENT_DATA {
...
if { not [info exists $::my_nodes($node)] } {
log "Unrecognized Terminal Server Node: $node"
reject
return
}
use node $::my_nodes($node) $port
...
}
The first approach is probably the safest as you don't have to keep the ::my_nodes array up-to-date with the current set of actual terminal servers.
Hope this helps.
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