Forum Discussion
James_21682
Nimbostratus
May 21, 2009Restrict access to VIP by source IP address
Afternoon,
I want to restrict access to a vip to only certain IP addresses, I have done that with the following iRule ( I took it from this forum)
when HTTP_REQUEST {
if { [IP::client_addr] eq "192.168.0.30" || [IP::client_addr] eq "192.168.3.10" || [IP::client_addr] eq "192.168.4.13" || [IP::client_addr] eq "192.168.5.16" } {
pool testapps2s
} else {
HTTP::respond 200 content "Not AllowedYou are not allowed to access this site!"
}
}
I want to add 3 different subnets to the above IPs (say 192.168.7.0, 192.168.9.0 and 102.168.12.0). How would I accomodate that in the iRule - I am a novice when it comes to this so any help would be appreciated.
Thanks
1 Reply
- hoolio
Cirrostratus
Hi,
It would be more efficient and easier to use an address type datagroup and the matchclass command (Click here) to do this. Try searching the forum for address type datagroup for more info.
Aaron
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