Forum Discussion
meena_60183
Nimbostratus
Jun 28, 2010Is this correct?
I am trying to write an irule where I perform snat based on the LB_SELECTED server address and this is what I have
when LB_SELECTED {
Check the CAS server and do SNAT
log local0. "LB server addr is [LB::server addr]"
if { [[LB::server addr] equals 10.60.252.6] } {
snat 10.60.253.246
set ::cas_selected "10.60.252.6"
log local0. "selected CAS is $::cas_selected"
forward
} elseif { [[LB::server addr] equals 10.60.252.7] } {
snat 10.60.253.247
set ::cas_selected "10.60.252.7"
log local0. "selected CAS is $::cas_selected"
forward
} elseif { [[LB::server addr] equals 10.60.252.8] } {
snat 10.60.253.248
set ::cas_selected "10.60.252.8"
log local0. "selected CAS is $::cas_selected"
forward
}
}
and I am getting this errorJun 28 15:30:42 tmm tmm[2236]: Rule force_traffic_to_cas_untrusted : LB server addr is 10.60.252.8
Jun 28 15:30:42 tmm tmm[2236]: 01220001:3: TCL error: force_traffic_to_cas_untrusted - invalid command name "10.60.252.8" while executing "[LB::server addr] equals "10.60.252.6""
on the ltm log. I could not figure out what the "invalid command name" is. Can anyone point me in the right direction?
- hoolio
Cirrostratus
Hi Meena,when LB_SELECTED { Check the CAS server and do SNAT log local0. "LB server addr is [LB::server addr]" if { [IP::addr [LB::server addr] equals 10.60.252.6] } { snat 10.60.253.246 set cas_selected "10.60.252.6" log local0. "selected CAS is $cas_selected" forward } elseif { [IP::addr [LB::server addr] equals 10.60.252.7] } { snat 10.60.253.247 set cas_selected "10.60.252.7" log local0. "selected CAS is $cas_selected" forward } elseif { [IP::addr [LB::server addr] equals 10.60.252.8] } { snat 10.60.253.248 set cas_selected "10.60.252.8" log local0. "selected CAS is $cas_selected" forward } }
- meena_60183
Nimbostratus
Thanks Aaron. - meena_60183
Nimbostratus
This is what I am trying to accomplish and I need some help. - meena_60183
Nimbostratus
I found a solution that works. I am not sure why I complicated it so much. The solution is rather very simple and easy to implement.
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