Forum Discussion
zhangyuyao_1600
Nimbostratus
Aug 04, 2016iRule can't execute the virtual command when using [clientside {TCP::local_port}]
There is an iRule below :
when CLIENT_ACCEPTED {
if {[IP::addr [IP::client_addr] equals 114.255.174.240] } {
set Destination_Port [clientside {TCP::local_port}]
if {($Destination...
Kai_Wilke
MVP
Aug 04, 2016Hi Zhangyuyao,
there is no need to switch into the client side context if you are already in the client side context. Using the
[clientside] / [serverside] command is just required in those usecases where you need to execute client side command in the server side context or a serverside command in the client side...
Try the irule below... it should be able to query the local portnumber and perform the
[pool] / [virtual] routing decission based on it.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 114.255.174.240] } then {
if { ([TCP::local_port] >= 10069) and ([TCP::local_port] <= 10124) } then {
virtual VS_4809_Troubleshooting_443
} elseif { ([TCP::local_port] >= 11069) and ([TCP::local_port] <= 11124) } then {
virtual VS_4809_Troubleshooting_80
} else {
pool pool_4809_Troubleshooting_443
}
}
}
Note: You can still issue the
command, but there is really no need to do so in the [clientside { TCP::local_port }]
event.CLIENT_ACCEPTED
Cheers, Kai
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