Forum Discussion

Raoni_S__Montei's avatar
Raoni_S__Montei
Icon for Nimbostratus rankNimbostratus
Jul 09, 2012

IRule error in routing traffic

Hello Gentlemen,

 

 

 

I would like to see if you can help me on an error appears in the following iRule:

 

 

 

when CLIENT_ACCEPTED {

 

if { [IP::addr[IP::client_addr]] equals 10.2.10.0/23 } {

 

if { [LB::status pool pool_citrix member 10.1.2.143 80] eq "down" } {

 

pool pool_citrix2

 

} else {

 

pool pool_citrix member 10.1.2.143 80

 

}

 

} else {

 

pool pool_citrix2

 

}

 

}

 

 

 

The error shown is as follows:

 

 

 

01070151:3: Rule [/ Common / Teste_Citrix] error:

 

line 2: [parse error: syntax PARSE 68 {syntax error in expression "[IP: addr [IP :: client_addr]] equals 10.2.10.0/23": extra tokens at end of expression}] [{[IP :: addr [IP: client_addr]] equals 10.2.10.0/23}]

 

 

 

The goal is that this iRule forwards all traffic from network 10.2.10.0/23 to the pool_citrix2.

 

 

 

Thanks for your help.

 

 

 

Best regards,

 

 

 

Raoni

 

  • can you try this?

     

     

    from:

     

    if { [IP::addr[IP::client_addr]] equals 10.2.10.0/23 } {

     

     

    to:

     

    if { [IP::addr[IP::client_addr] equals 10.2.10.0/23] } {
  • Hello

     

     

    The iRule not had any further problems in its creation, however it did not show the expected result.

     

     

    With that, I would like to request a new help for it to go to work.

     

     

    The purpose of the iRule is that when a host tries to access the network 10.2.10.0/23 pool_citrix, it is forwarded to the member pool 10.1.2.143.

     

     

    The rest should go to the pool_citrix2 which includes the other members.

     

     

    With this in VS as I put the pool default pool_citrix and add the iRule created right?
  • i think your irule looks okay. can you add some logging to the irule?

    e.g.

    when SERVER_CONNECTED {
            log local0. "[IP::client_addr]:[TCP::client_port] -> [clientside {IP::local_addr}]:[clientside {TCP::local_port}] -> [IP::remote_addr]:[TCP::remote_port]"
    }