Does anyone know why we are getting this iRule parsing or formatting error after upgrading our BigIP from 12.x to version 13.1.3.3? After upgrading, the irule that was working is no longer working and causing the website not to load. Not sure why the newer version of this code is disregarding the syntax for the “Check_IP” field. Can only one help in changing the irule so that it will work?
It looks like it has to do with the “CHECK_IP” get field. What we are doing is checking the XFF header first to see the client IP and make decision based on that to allow or deny the URIs the go to.
Error:
err tmm3[16683]: 01220001:3: TCL error: /Common/Web-iRule <HTTP_REQUEST> - bad IP network address format (line 5)invalid IP match item for IP class /Common/Data-Group-Allowed-IPs (line 5) invoked from within “class match $CHECK_IP eq Data-Group-Allowed-IPs”
when HTTP_REQUEST {
if { [active_members POOL-EXT-WEB-SERVERS] < 1 } {
HTTP::redirect " http://maintenance.domain.com"
} else {
set CHECK_IP [getfield [HTTP::header values X-Forwarded-For] " " 1]
if { !([class match $CHECK_IP eq Data-Group-Allowed-IPs]) } {
if { [class match [HTTP::uri] eq Data-Group-URI-List] } {
reject }
}
switch -glob [HTTP::uri] {
"*/level1/level2/portal/login*" -
"*/level3/testlogin1*" -
"*/aa/bb/portal/testlogin2*" {
if { ([class match $CHECK_IP eq Data-Group-Allowed-IPs]) } {
if { [HTTP::uri] contains "/home/admin1" } {
HTTP::redirect "https://[HTTP::host]/home/admin2"
} else {
HTTP::redirect "https://[HTTP::host]/aa/bb/login/"
}
}
}
}
}
}
F5 Product Development has assigned ID 704587 to this issue. F5 has confirmed that this issue exists in the products listed in the Applies to (see versions) box, located in the upper-right corner of this article. For information about releases, point releases, or hotfixes that resolve this issue, refer to the following table.
Note that we are not trying to insert an IP address into the XFF header, but instead read the client-IP already inserted, and from there allow or deny/redirect based on a match or not. I used the IP called from within the data group for the match. If it does not, we know it is not coming from a location we allow and it should allow or deny based on that. This was working before the upgrade to 13.1.3.