Forum Discussion

John_Nootens_45's avatar
John_Nootens_45
Icon for Nimbostratus rankNimbostratus
Jul 01, 2005

irule format/syntax

Below is the rule I plan to implement. Can you tell me if I have the format/syntax correct. I copied it from another 4.x box and changed the 'if' condition. I am using a config guide from 9.x, is there syntax information in a 4.x online manual somewhere?

 

Any help will be greatly appreciated. John

 

 

MARS-VIP

 

--------

 

161.215.151.52:45000

 

Use Rule MARS-rule

 

 

MARS-rule

 

---------

 

if (IP::client_addr eq 161.215.54.193 ) {

 

use ( MARS-pool1 )

 

}

 

else {

 

use ( MARS-pool2 )

 

}

 

 

MARS-pool1

 

----------

 

57.23.40.197:6014 priority 2

 

57.23.40.197:6008 priority 1

 

 

MARS-pool2

 

----------

 

57.23.40.197:6014 priority 1

 

57.23.40.197:6008 priority 2

 

 

 

  • You are close. the IP::client_addr is a 9.x variable. You want to use the 4.x client_addr. Also, the parantheses around the use pool commands will cause a validation error.

    If you go through the 4.x GUI, you can create this rule via the rules wizard. It will look something like this:

     if (client_addr == 161.215.54.193) { 
        use pool MARS-pool1 
     } else { 
        use pool MARS-pool2 
     }

    And, yes, there is an online manual available on the 4.x device itself. Look for the "BIG-IP Reference Manual" on the front GUI page. You can also reference the manuals via our tech.f5.com support site (you'll need your support username/password to get in there though). Look for "Chapter 5 - iRules".

    -Joe