Forum Discussion
Jimmy_124170
Nimbostratus
Jun 26, 2013iRules that allow or deny access to a VIP based on src IP
Hello. I try to create an iRule that allow or deny access to certain ranks of a given IP vip. I tried to find an existing topic on the forum and I have not found. if there is and you know where it is, please tell me. it would be really appreciated.
Now here's what I did.
when CLIENT_ACCEPTED {
set dcfw_mapping_dg {/Common/jimmy_ip}
while {1} {
set dcfw_vdg [ class match -value 142.125.251.70 equals $dcfw_mapping_dg ]
if { ! [ class exists $dcfw_vdg ] } { break }
if { [ class match [IP::remote_addr] equals $dcfw_vdg ] } { break }
return
}
}
The problem is that my access is never denied. I always can access my VIP. I put the logs to see if my iRules was called and yes, it is.
2 Replies
- Kevin_Stewart
Employee
You can significantly simplify this iRule:when CLIENT_ACCEPTED { if { not ( [class match [IP::client_addr] equals jimmy_ip] ) } { reject } } - Jimmy_124170
Nimbostratus
Thank youvery much.This is exactly whatI need
Simple, straight to the point.
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