Forum Discussion
Spiderman_11815
Nimbostratus
Jan 23, 2013iRule for Conditional SNAT not working
Need help. iRule to perform source NAT based on source IP is not working. Requirement is "not to NAT" when source IP is from 172.21.10.0/24 and NAT for everything else. Even when I source it from the...
Spiderman_11815
Nimbostratus
Jan 23, 2013Here is the log I am getting after this.
Jan 23 13:40:32 local/tmm1 info tmm1[6860]: Rule test6 : SNAT for: 10.75.134.8%2 (It does not work)
Jan 23 13:40:51 local/tmm2 info tmm2[6861]: Rule test6 : SNAT for: 172.22.10.128%2 ( It is working but not sure why it did not encounter a match prior to this and exit)
IP:addr variable was not working. So I modified the irule as below.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 172.21.10.0/24] } {
log local0. "Not NATing for: [IP::client_addr]"
snat none
Stop processing the iRule
return
} else {
snatpool
log local0. "SNAT for: [IP::client_addr]"
}
}
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