Forum Discussion

Joseph_Goyette_'s avatar
Joseph_Goyette_
Icon for Nimbostratus rankNimbostratus
Mar 28, 2005

matchclass + IP::remote_addr ?

Hi there,

I'm experiencing some odd behaviour when I attempt to develop an iRule that contains both a uri match and remote ip address check. The irule is below.

The odd behaviour appears as a "Document Contains No Data" popup message on my browser or a "page cannot be displayed" message whenever any of the ip address checks is TRUE and I've started my url with /CustomerX/ . The other redirect sections and the /junk/ check work as expected.

 
 when HTTP_REQUEST  
 {  
    if {[HTTP::uri] starts_with "/junk/"} {  
       pool JOE-web003  
    }  
    elseif {[HTTP::uri] starts_with "/CustomerX/"} {  
       if { [matchclass [IP::remote_addr] equals $::block1] } {  
          pool JOE-web003  
       }  
       elseif { [matchclass [IP::remote_addr] equals $::block2] } {  
          pool JOE-web003  
       }  
       elseif { [matchclass [IP::remote_addr] equals $::block3] } {  
           pool JOE-web003  
       }  
       else {  
          HTTP::redirect "http://www.cnn.com/"  
       }  
    }  
    else {  
       HTTP::redirect "http://www.goyette.net/"  
    }  
   
 }  
 

Has anyone here seen this type of behaviour before ? Is my rule constructed correctly ?

Thank you for any help !

Joe

1 Reply

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    Joe,

     

    I do not see anything specifically wrong with your rule.

     

    However, you may be running into a run-time error. These are logged in /var/log/ltm.

     

     

    Since you have the "elseif" listed on a new line, I might suspect you are running into the whitespace problem documented in these posts:

     

    http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=2073

     

    http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=2033