Filter for FTP access

I am new to iRules and am porting some from 4.x to 9.x. I have the following question.

We have an FTP rule which only allows access to specified clients. In version 4.x it had no event to trigger the rule but in 9.x I believe the rule needs to be triggered by an event (is this a correct assumption?).

when XXX {

if {[IP:addr [IP::client_addr] equals aa.bb.cc.dd]} {

use pool ftp

}

else {

discard

}

}

What is the XXX event I should use to trigger the iRule? (USER_REQUEST?), or am I going about this the wrong way?

Thanks

you’re on the right track.

The event you are looking for is “CLIENT_ACCEPTED”:

when CLIENT_ACCEPTED {
  if {[IP:addr [IP::client_addr] equals aa.bb.cc.dd]} {
    use pool ftp
  } else {
    discard
  }
}

/deb

Perfect - Thanks Deb