Forum Discussion
tacobell_112236
Mar 04, 2011Nimbostratus
IRule Disaster
I'm running F5 LTM ver 9....and when I add IRule to VS I get "internet cannot display page" BUT Once I remove IRule I get the website....
i need to alllow only my datagroup access to the ur...
tacobell_112236
Mar 31, 2011Nimbostratus
Can someone assist- my IRule is not working correctly.
basically:
if you are part of the address_datagroup & you are accessing URI in the uri_datagroup =allow access
if you are not part of the address_datagroup & you are accessing URI in the uri_datagroup=redirect
when HTTP_REQUEST {
log local0. "client IP is [IP::client_addr]"
if { [matchclass [IP::client_addr] eq address_datagroup] } {
if { [string tolower [HTTP::host]] equals "XX.XXX.com" and [matchclass [string tolower [HTTP::uri]] starts_with XX_XXX_com_uri_datagroup] } {
HTTP::redirect "http://XX.XXX.com"
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to "
} elseif { [string tolower [HTTP::host]] equals "XX.XXX.com" and [matchclass [string tolower [HTTP::uri]] starts_with www_newark_com_uri_datagroup] } { HTTP::redirect http://XX.XXX.com
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to http://xx.xxx.com"
} elseif { [string tolower [HTTP::host]] equals "xx.xxxx.com" and [matchclass [string tolower [HTTP::uri]] starts_with www_xxx_com_uri_datagroup] } { HTTP::redirect "http://xx.xxx.com" }
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to http://xx.xxx.com"
} elseif { [string tolower [HTTP::host]] equals "xx.xxxcom" and [matchclass [string tolower [HTTP::uri]] starts_with www_xxxxxcom_uri_datagroup] } { HTTP::redirect "http://xx.xxxx.com"
log local0. "client: [IP::client_addr] requested [HTTP::host][HTTP::uri] and is not part of address_datagroup so they are redirected to http://xx.xxxx.com" } }
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