Forum Discussion
rachitbiyani_21
Aug 13, 2015Nimbostratus
Equivalent iRules have different behavior
Hello,
I have configured the following iRule on a Virtual Edition BigIP F5:
when CLIENT_ACCEPTED {snat [clientside {IP::local_addr}]}
and it works as expected - It translates the sourc...
- Aug 13, 2015
It loads correctly for me (when using
and pasting intotmsh edit ltm rule foo
under 11.6.0). I suspect this may be a character insertion issue. If, for example, you paste in Windows-style newlines at the end (which will naturally be invisible to you), the iRule parser will not interpret the newlines in the way you expect. Indeed, based on the error, it appears to be compressing the two statements together. Incidentally, the space after the variable name is required.vi
Aug 13, 2015
Enclosing the snat command in curly braces causes it to not execute and be treated as a literal. Try this
when CLIENT_ACCEPTED {
set VirtualIP [clientside {IP::local_addr}]
snat $VirtualIP
}
What is the need for storing the value sent to the snat command inside a variable? That takes up memory space and if you aren't using it in other areas of the iRule (logging, etc), then you are better off just going with your original code
when CLIENT_ACCEPTED {
snat [clientside {IP::local_addr}]
}
-Joe
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