Forum Discussion
iRule to autonat for specific client subnets
Tom
- Thomas_Knutson_NimbostratusI did some more looking around, and think I may have been able to adapt an iRule to acomplish this. Will the iRule below work, or is there a better way for me to write it?
when CLIENT_ACCEPTED {
if { [IP::addr [IP::remote_addr] equals xx.xx.xx.xx/24] } {
snat automap
} elseif { [IP::addr [IP::remote_addr] equals yy.yy.yy.yy/24] } {
snat automap
} elseif { [IP::addr [IP::remote_addr] equals zz.zz.zz.zz/24] } {
snat automap
} else {
return
}
}
- hoolioCirrostratusHi Thomas,
when CLIENT_ACCEPTED { Check if the client IP is in the client_ip_class datagroup if {[class match [IP::client_addr] equals client_ip_class]}{ snat automap } }
- Thomas_Knutson_NimbostratusAaron,
Great, I will give that a try instead of my original iRule. By using a datagroup, will that cause the iRule to perform better? I'm still getting the hang of these devices, and sometimes am unsure of weather to use a datagroup or not when building rules?
Thomas
- hoolioCirrostratusA class lookup against a datagroup should be more efficient in most cases. See Joe's article here for complete details:
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