Forum Discussion
iRule not executing
Upgraded to v11.5.1 with Hotfix-HF2. created first new pool & virtual and assigned a HTTP Redirect iRule :
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "http://crm.murrob.com:5555/murrayroberts" } }
both pool and VS service port set to 5555
however it does not re-direct and when I look at the iRule statistics I see 0 Executions...
I have many other exact re-direct rules (different service ports & url) and they work.
any suggestions will be appreciated
22 Replies
- What_Lies_Bene1
Cirrostratus
Is a HTTP profile assigned to the VS?
- nitass_89166
Noctilucent
if you run curl on bigip, is it executed?
curl -I http://virtual_server_ip/- AfterFax_148580
Nimbostratus
curl: (7) couldn't connect to host - however both pool & VS are green - nitass_89166
Noctilucent
sorry i forgot port number. curl -I http://virtual_server_ip:5555/ - AfterFax_148580
Nimbostratus
Strange .. it only appends triple 5 and not 5555 HTTP/1.0 302 Found Location: http://crm.murrob.com:555/murrayroberts Server: BigIP Connection: Keep-Alive Content-Length: 0
- nitass
Employee
if you run curl on bigip, is it executed?
curl -I http://virtual_server_ip/- AfterFax_148580
Nimbostratus
curl: (7) couldn't connect to host - however both pool & VS are green - nitass
Employee
sorry i forgot port number. curl -I http://virtual_server_ip:5555/ - AfterFax_148580
Nimbostratus
Strange .. it only appends triple 5 and not 5555 HTTP/1.0 302 Found Location: http://crm.murrob.com:555/murrayroberts Server: BigIP Connection: Keep-Alive Content-Length: 0
- Kevin_Stewart
Employee
Perhaps some additional logging?
when HTTP_REQUEST { log local0. "incoming URI = [HTTP::uri]" if { [HTTP::uri] equals "/" } { log local0. "catch and redirect for /" HTTP::redirect "http://crm.murrob.com:5555/murrayroberts" } } - nitass_89166
Noctilucent
Strange .. it only appends triple 5 and not 5555
it seems okay here.
test [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10:5555/ HTTP/1.0 302 Found Location: http://crm.murrob.com:5555/murrayroberts Server: BigIP Connection: Keep-Alive Content-Length: 0 config [root@ve11a:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "http://crm.murrob.com:5555/murrayroberts" } } }- AfterFax_148580
Nimbostratus
okay my mistake - made a typo, both curl and tmsh list outputs shows the four digit port number - however still no redirect
- nitass
Employee
Strange .. it only appends triple 5 and not 5555
it seems okay here.
test [root@ve11a:Active:In Sync] config curl -I http://172.28.24.10:5555/ HTTP/1.0 302 Found Location: http://crm.murrob.com:5555/murrayroberts Server: BigIP Connection: Keep-Alive Content-Length: 0 config [root@ve11a:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "http://crm.murrob.com:5555/murrayroberts" } } }- AfterFax_148580
Nimbostratus
okay my mistake - made a typo, both curl and tmsh list outputs shows the four digit port number - however still no redirect
- nitass
Employee
both curl and tmsh list outputs shows the four digit port number - however still no redirect
if curl shows redirection correctly but it still does not work, you may have to try tcpdump on bigip and/or http analyzer tool on client to see where the wrong is.
HttpFox
https://addons.mozilla.org/en-US/firefox/addon/httpfox/for tcpdump, you may try this.
tcpdump -nni 0.0:nnnp -s0 -w /var/tmp/output.pcap host x.x.x.x -v x.x.x.x is client ip- AfterFax_148580
Nimbostratus
did the tcpdump and the source port (me) is a random high port, destination port is 80 - this tells me the iRule does not execute? - AfterFax_148580
Nimbostratus
Right - I left the pool on port 5555, changed the VS to port 80 & removed the :5555 so the rule now redirect to this : http://crm.murrob.com:/murrayroberts this solved the problem ... thanks for all the assistance
- nitass_89166
Noctilucent
both curl and tmsh list outputs shows the four digit port number - however still no redirect
if curl shows redirection correctly but it still does not work, you may have to try tcpdump on bigip and/or http analyzer tool on client to see where the wrong is.
HttpFox
https://addons.mozilla.org/en-US/firefox/addon/httpfox/for tcpdump, you may try this.
tcpdump -nni 0.0:nnnp -s0 -w /var/tmp/output.pcap host x.x.x.x -v x.x.x.x is client ip- AfterFax_148580
Nimbostratus
did the tcpdump and the source port (me) is a random high port, destination port is 80 - this tells me the iRule does not execute? - AfterFax_148580
Nimbostratus
Right - I left the pool on port 5555, changed the VS to port 80 & removed the :5555 so the rule now redirect to this : http://crm.murrob.com:/murrayroberts this solved the problem ... thanks for all the assistance
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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