Forum Discussion
hirox_127495
15 years agoHistoric F5 Account
How do I drop packet from iRules?
Hello,
I created following iRule to enforce connection/second. This iRule supposes to drop client request when LTM get more than 5 connections per second. But actual behavior of 10.2 was send RST back to the client in my verification.
How do I modify this iRule to work as I expected?
---------------------------------------
when CLIENT_ACCEPTED {
set reqno [table incr "reqs"]
table set -subtable "reqrate" $reqno "ignored" indefinite 1
set ConRate [table keys -count -subtable "reqrate"]
if { $ConRate > 5 } {
drop
event disable
return
}
}
---------------------------------------
Thanks!
3 Replies
- The_Bhattman
Nimbostratus
Have you looked at the following code share?
http://devcentral.f5.com/wiki/default.aspx/iRules/LimitConnectionsFromClient.html
I hope this helps
Bhattman - hirox_127495Historic F5 AccountThank you for the information but I just want to know behavior of "drop" command.
In my understanding, an iRule fires "reject" command, LTM sends RST to the peer but firing "drop" command does nothing.
However I am seeing to send RST to the peer from LTM even though I use "drop" command. Do I need to open a support case? - hoolio
Cirrostratus
I'd have expected drop to either drop the current packet or to remove the connection table entry. I'd guess that drop called in CLIENT_ACCEPTED would remove the connection table entry. Maybe if it's used in a DATA event (like CLIENT_DATA or SERVER_DATA) it would just drop the current packet. If the connection table entry is removed and the client sends another packet, LTM should reset it as it's not associated with an existing connection.
You could open a case with F5 to confirm or correct these assumptions. If you do, could you reply back with what you find out?
Thanks, Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects