Forum Discussion
winifred_corbet
Nimbostratus
May 20, 2010allow access to URL by specific IP range - all others rejected
For a specific URL I need to allow access to URL only to our internal IP range, all other IP addresses need to be rejected.
Something along these lines, but clearly this is not correct. Can anyone help?
when HTTP_REQUEST {
{[HTTP::uri] "special_file"}
{ [IP::addr [IP::remote_addr] equals 72.xxx.xxx.0/72.xxx.xxx.26 ] } {
reject
}
}
- Michael_Yates
Nimbostratus
Sorry...I had to edit my first post and the format is never the same after an edit:when HTTP_REQUEST { if { [HTTP::host] equals "www.website.com" and ([matchclass [IP::remote_addr] equals $::PoolOfAllowedAddresses ]) } { pool poolofallowedservers } else { reject } }
- winifred_corbet
Nimbostratus
excellent. I will give it a try. Thanks. - winifred_corbet
Nimbostratus
Another question: - Michael_Yates
Nimbostratus
If you need to be extremely specific you can have it check the URI as well.when HTTP_REQUEST { if { [HTTP::host] equals "www.website.com" and [HTTP::uri] equals "/somethingspecific/index.html" and [matchclass [IP::remote_addr] equals $::PoolOfAllowedAddresses ]) } { pool poolofallowedservers } else { reject } }
when HTTP_REQUEST { if { [HTTP::host] equals "www.website.com" and [HTTP::uri] equals "/somethingspecific/index.html" and !([matchclass [IP::remote_addr] equals $::PoolOfAllowedAddresses ]) } { reject } else { pool poolofallowedservers } }
- Ahmad_Ghazal_17
Nimbostratus
Hi, what the following line means, and what it's used for? pool poolofallowedservers - nitass
Employee
poolofallowedservers is pool name. the command does send traffic to that pool.
- If you need to be extremely specific you can have it check the URI as well.
when HTTP_REQUEST { if { [HTTP::host] equals "www.website.com" and [HTTP::uri] equals "/somethingspecific/index.html" and [matchclass [IP::remote_addr] equals $::PoolOfAllowedAddresses ]) } { pool poolofallowedservers } else { reject } }
when HTTP_REQUEST { if { [HTTP::host] equals "www.website.com" and [HTTP::uri] equals "/somethingspecific/index.html" and !([matchclass [IP::remote_addr] equals $::PoolOfAllowedAddresses ]) } { reject } else { pool poolofallowedservers } }
- Ahmad_Ghazal_17
Nimbostratus
Hi, what the following line means, and what it's used for? pool poolofallowedservers - nitass
Employee
poolofallowedservers is pool name. the command does send traffic to that pool.
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