MW1
Apr 29, 2013Cirrus
Can someone advise if this format of external class file (old v9.3.1) for addresses is in the correct formatt
Hi,
I have an irule that I have mashed together that checks the clients IP against a list in a file held locally on the F5 which works when I use an internal data group but is failing when I use an external one. It is on a very old 9.3.1 ltm. The F5 did not complain when I set it up however the matching does not appear to be working:
config b class IPlist list
class IPlist extern {
type ip
filename "/var/class/IPlist"
}
config cat /var/class/IPlist
host 172.30.0.30,
host 192.16.83.5,
host 128.44.5.3,
host 94.11.71.11,
host 128.33.4.3,
The Irule is
when HTTP_REQUEST {
log local0. "TEST-irule request coming"
switch -glob [string tolower [HTTP::uri]] {
"/medq_esb/proxy_services*" {
Only check POST requests
if { [HTTP::method] eq "POST" } {
log local0. "TEST-irule post request"
Default amount of request payload to collect (in bytes)
set collect_length 2048
Check for a non-existent Content-Length header
if {[HTTP::header Content-Length] eq ""}{
Use default collect length of 2k for POSTs without a Content-Length header
set collect_length $collect_length
} elseif {[HTTP::header Content-Length] == 0}{
Don't try collect a payload if there isn't one
unset collect_length
log local0. "TEST-irule no content length"
} elseif {[HTTP::header Content-Length] > $collect_length}{
Use default collect length
set collect_length $collect_length
} else {
Collect the actual payload length
set collect_length [HTTP::header Content-Length]
}
If the POST Content-Length isn't 0, collect (a portion of) the payload
if {[info exists collect_length]}{
Trigger collection of the request payload
HTTP::collect $collect_length
log local0. "TEST-irule going to collect request"
}
} else
{ pool company7_osb_pool } }
"/platform-webservices/filetransferdatatransferservices*" { pool company7_filetransfer_pool }
"/webservices/company*" { pool QASAR }
"/urls/forgot-password"
{ HTTP::redirect "https://ca.company.com/utilities/psa.aspx?ACT=REQPASS" }
"/urls/forgot-username"
{ HTTP::redirect "https://ca.company.com/utilities/psa.aspx?ACT=REQUNAME" }
default
{ discard
log local0. "TEST-irule request discarded" }
}
}
when HTTP_REQUEST_DATA {
set data {
Your IP address has not been recognized.
Please contact company support.false
}
Match the data for specific companyid and is a login request
if { [HTTP::payload] contains ">123" and [HTTP::payload] contains " log local0. "TEST-irule matched company and login request"
Match the clients IP to register list and respond with block MSG if not found
if { ![matchclass [IP::client_addr] equals $::IPlist] } {
log local0. "TEST-irule going to reply with block to [IP::client_addr] "
HTTP::respond 200 content $data "Content-Type" "text/xml; charset=utf-8"
}
else { pool company7_osb_pool
log local0. "TEST-irule IP Matched"
}
}
pool company7_osb_pool
log local0. "TEST-irule no company and login request match"
}