Forum Discussion
Destination based i-rule not working
Hi ,
I have a VIP which listens on specific port . I already have an irule created for snat none but that is on client_addr basis.
I want to create an irule which will do no snat based on the destination IP address. Means if a request comes to VIP for particular destination then it will not do snat for that request and forward that to the respective pool member
BIG IP OS version is 10.2 .
Below is the syntax that I have created but its not working. Kindly guide me if I have missed something .
when CLIENT_ACCEPTED { if { [class match [IP::local_addr] equals no-nat-destination-based] } { snat none log local0. "Client/Source Address -> IP address [IP::client_addr]" log local0. "Local/Destination Address -> IP address [IP::local_addr]"
} }
2 Replies
- MichaelatF5
Employee
Try this, if the client is on the same subnet it will not snat, if client is NOT on the same subnet, it will snat. Change [pool/automap/none] as needed:
when LB_SELECTED { if {[IP::addr "[IP::client_addr]/24" equals "[LB::server addr]/24"]} { snat [pool/automap/none] } else { snat none } } Hi Vinitshah,
you have to keep in mind that
is the IP address of the virtual server. To have a SNAT exemption based on the pool members IP address, you have to use the[IP::local_addr]
command. But this command is only valid for after a pool member was selected (e.g.[LB::server addr]
and later events)LB_SELECTEDwhen LB_SELECTED { if { [class match [LB::server addr] equals no-nat-destination-based] } then { snat none log local0. "Client/Source Address -> IP address [IP::client_addr]" log local0. "Server/Destination Address -> IP address [LB::server addr]" } }Cheers, Kai
Recent Discussions
Related Content
* 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