Forum Discussion

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

setting up a 0.0.0.0 virtual server with irule

I'm new to irules and pulling my hair to get this working...

 

 

in a two armed design, with multiple external and multiple internal interfaces:

 

 

setup a virtual server 0.0.0.0 with port 0, which uses the following irule

 

 

when CLIENT_ACCEPTED {

 

if{[[IP::local_addr] equals 172.18.200.254]}{pool default-gateway-1}

 

elseif{[[IP::local_addr] equals 172.18.203.253]}{pool default-gateway-2}

 

else{pool default-gateway-SNAT}

 

}

 

 

what type of virtual server should the vip 0.0.0.0 be? Can a vip be up without a default pool?

 

 

Thanks for your input.

 

 

Sheila

 

 

  • drteeth_127330's avatar
    drteeth_127330
    Historic F5 Account
    There is no need for a default pool as long as a pool is always selected by an iRule. Based on your rule, this virtual should probably be a FastL4 virtual with translate addr and translate service disabled. Alternatively, you should be able to configure an IP Forwarding virtual in the GUI. This is really just a shortcut for the same thing.
  • Drteeth

     

     

    Thanks for the reply. I just set it as fastL4 with the irule but when I check irules statistics, all the execution failed. And the 0.0.0.0 virtual server remains down.

     

     

    Anything you see would cause the irule to fail?

     

     

    Sheila

     

  • unRuleY_95363's avatar
    unRuleY_95363
    Historic F5 Account
    A couple of things about your actual rule:

    1) You will want to use the IP::addr command to compare your addresses

    2) You want to be careful with whitespace separating statements, otherwise Tcl may get confused about which arguments are which.

    Try this:

     
     when CLIENT_ACCEPTED { 
        if {[IP::addr [IP::local_addr] equals 172.18.200.254]} { 
           pool default-gateway-1 
        } elseif {[IP::addr [IP::local_addr] equals 172.18.203.253]} { 
           pool default-gateway-2 
        } else { 
           pool default-gateway-SNAT 
        } 
     }