Forum Discussion

coda6_52611's avatar
coda6_52611
Icon for Nimbostratus rankNimbostratus
Nov 13, 2012

Trying to get the Syntax right.

 

So I am trying to get an iRule that allows only servers I approve of on the VIP. So I created a class named allowed_servers and if the IP doesn't match that list I want the VIP to drop the connection.

 

 

So this is what I came up with but the iRule editor always tells me that "line 2: [parse error: PARSE missingBracket 28 {missing close-bracket}] [{[class matches [string[IP::client_addr] not equals allowed_servers]}]"

 

 

I can't find where I am supposed to put that close-bracket, can anyone help?

 

 

 

when CLIENT_ACCEPTED {

 

if {[class matches [string[IP::client_addr] not equals allowed_servers]}

 

{drop}

 

}

 

 

 

 

 

Thanks,

 

 

Ken

 

2 Replies

  • Hi Ken,

    That's close. Here you go:

    
    when CLIENT_ACCEPTED {
    if { not [class match [IP::client_addr] equals allowed_servers]}{
    drop
    }
    }
    

    Aaron
  • Thank you, the iRule editor likes that much better.

     

     

    I appreciate the help.