Forum Discussion
node select iRule
Hi,
I got the following error in the log: May 12 09:07:04 bigip err tmm[9415]: 01220001:3: TCL error: /Common/mediaroot - bad IP address format (line 😎 invoked from within "node "10.1.1.$node_ip" 80"
I have now found that if I use I URL other than a number or /mediaroot/ as the 4:th argument in the URI the iRule do not match any of the if statements. What I have done is that I modified the first elseif statement to elseif { $node_ip starts_with "1" || $node_ip starts_with "2" && $node_ip >= 160 } to check that its a number and then added an else statement that drops the connection if its not matching the other statements.
when HTTP_REQUEST {
set node_ip [getfield [HTTP::uri] "/" 4]
if { [HTTP::uri] starts_with “/foo/bar/mediaroot/“ } {
log local0. "starts with /foo/bar/mediaroot/"
pool mediaroot-pool
} elseif { $node_ip starts_with "1" || $node_ip starts_with "2" && $node_ip >= 160 } {
HTTP::uri [string map [list $node_ip ""] [HTTP::uri]]
node "10.1.1.$node_ip" 80
} else {
drop
}
}
Recent Discussions
Related Content
* 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