Forum Discussion
Restrict FTP traffic on VIP to IP address or range
I have a contractor who requires FTP access to an FTP server on our network.
We have created a VIP that only allows traffic on port 21 to that server. We only want to allow an IP address or a range of IPs to access that specific server, and this is just a temporary access issue.
It is my understanding that we need to incorporate when CLIENT_ACCEPTED { into our iRule in order to accomplish this. I've found the following iRule, however it seems much more complex than what we're looking to do.
http://devcentral.f5.com/wiki/default.aspx/iRules/AccessControlBasedOnNetworkOrHost.html
I was thinking that something like this below would work, but this iRule seems to check the login name rather than the IP address or network that traffic would be coming into via port 21.
when CLIENT_ACCEPTED {
if { [matchclass [IP::remote_addr] equals $::aol] } {
pool aol_pool
} else {
pool all_pool
}
}
- hooleylistCirrostratusHi Joe,
when CLIENT_ACCEPTED { Check if client IP is not in the allowed_clients_datagroup if { not [matchclass [IP::client_addr] equals allowed_clients_datagroup]}{ Disallowed client IP, send a tcp reset reject } }
- Joe_PipitoneNimbostratusAs always - thank you!
- OMNimbostratusHi,
- hooleylistCirrostratusHi Omar,
- OMNimbostratusThanks Aaron for your quick reply,
I have 2 partitions (prod and dev). The vs, the irules and the datagroup are all in the same partition (dev).
In the doc, the iRule syntax is slightly different depending whether we use the default route domain or unique route domain...
Would you please confirm the syntax of the iRule?
thanks.
Omar
- hooleylistCirrostratusHi Omar,
- kavan_49451Nimbostratus
Hi Guys I have a couple of questions regarding this IRule, I hope someone can advise.
- Michael_YatesNimbostratusThere is no limit or hard number of iRules that you can run on a BigIP. It all depends on the intensity of the iRules that you implement.
- @kavan
- Colin_Walker_12Historic F5 AccountAs has been mentioned above, just because you can do everything under the sun in an iRule doesn't necessarily mean you should. As is mentioned in the Ten Steps to iRules Optimization Click Here making use of the right tool for the job is important. If your deployment dictates that your LTM is the best place to do this, then it can certainly fill the role, but whether or not you "should" do this here is highly dependent on your environment and deployment.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com