Forum Discussion

smiley_dba_1116's avatar
smiley_dba_1116
Icon for Nimbostratus rankNimbostratus
Nov 01, 2012

iRule detect any IP that comes in at x rate a minute

Lets say we have an external IP coming in and is completely over taxing a VS. Is there a way within an iRule(or profile) to throttle the connection? In this case

 

external ---------------------------> VS

 

166.166.166.166 -------------->270.270.270.270

 

Using up to 300 MB of bandwidth. Want to throttle to 50mb. Thank you for anyone who can help.

 

RGW

 

5 Replies

  • is this applicable?

     

     

    Simple traffic shaping by JackofallTrades

     

    https://devcentral.f5.com/wiki/iRules.Simple_traffic_shaping.ashx
  • Alternatively you could create a Rate Class and apply it in the iRule, based on the source IP. Is the high bandwidth inbound or outbound?
  • OK, so I knocked this up;

    
    when CLIENT_ACCEPTED {
     if { [IP::addr [IP::client_addr] equals x.x.x.x] } {
      rateclass name_of_your_rateclass
      log local0. "Bandwidth Hog: [IP::client_addr] detected, Rate Class applied."
     }
    }
    

    And found this right afterwards (which has an example which is essentially the same): https://devcentral.f5.com/wiki/iRules.rateclass.ashx

    No idea what happens if the client opens multiple connections. Perhaps you can let us know?