Forum Discussion
Touch_100239
Nimbostratus
Aug 02, 2010iRule Implementation (SNAT)
Hi All
I am new about F5 iRule and facing a problem about iRule implementation on F5. I was struggling with it for more than two weeks. Really hope if there is someone could help me to solve it.
My sc...
The_Bhattman
Nimbostratus
Aug 02, 2010Hi Touch,
Undestood. Thank you for the clarification.
Let me rephrase the what I think might be happening and what you can do.
There are 2 items that might be causing your issue
1) You are using matchclass command without a datagroup
2) The iRule event you are using (CLIENT_ACCEPTED) is only triggered when the client side of the connection is established but before the F5 has choosen the server IP through it's normal load balancing decision that you have configured.
My thoughts are to use LB_SELECTED event which is triggered after the F5 has choosen the pool member and replacing the matchclass command
The iRule would look like the following
when LB_SELECTED {
log local0 "The Client IP is [IP::client_addr] and the node IP is [IP::remote_addr]"
if {[IP::addr [IP::client_addr] equals 192.168.1.2] and [IP::addr [LB::server addr] equals 192.168.2.2]} {
snat 192.168.2.3
} else {
snat none
}
}
I hope this helps
Bhattman
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