Forum Discussion

AfterFax_148580's avatar
AfterFax_148580
Icon for Nimbostratus rankNimbostratus
May 20, 2014

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

  • if you run curl on bigip, is it executed?

     curl -I http://virtual_server_ip/
    
    • nitass_89166's avatar
      nitass_89166
      Icon for Noctilucent rankNoctilucent
      sorry i forgot port number. curl -I http://virtual_server_ip:5555/
    • AfterFax_148580's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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
  • if you run curl on bigip, is it executed?

     curl -I http://virtual_server_ip/
    
    • nitass's avatar
      nitass
      Icon for Employee rankEmployee
      sorry i forgot port number. curl -I http://virtual_server_ip:5555/
    • AfterFax_148580's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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
  • 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" 
        } 
    }
    
  • 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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      okay my mistake - made a typo, both curl and tmsh list outputs shows the four digit port number - however still no redirect
  • 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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      okay my mistake - made a typo, both curl and tmsh list outputs shows the four digit port number - however still no redirect
  • 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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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
  • 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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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's avatar
      AfterFax_148580
      Icon for Nimbostratus rankNimbostratus
      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