Forum Discussion

Ken_Wong_48678's avatar
Ken_Wong_48678
Historic F5 Account
May 11, 2007

iRules for rate shaping

Hi,

 

 

I have an iRule that can be used to control the bandwidth usage by ip address. But, a customer is asking that their users use proxy servers to access internet. All traffic is come from a proxy server ip, I have an idea to suggest they enable the XForwarded For header in proxy servers and LTM inspect the header to apply the rate class. Has anyone tries before or is there any other suggestions? Thanks in advance.

 

 

Regards,

 

Ken

 

 

rule Rateshaping_IP {

 

Paying users get the bandwidth

 

User's IPs defined in the iRules/DataGroups

 

 

when CLIENT_ACCEPTED {

 

if { [[IP::client_addr] eq matchclass gold_users] } {

 

rateclass rateshape_10mb

 

}

 

elseif { [[IP::client_addr] eq matchclass silver_users] } {

 

rateclass rateshape_512k

 

}

 

elseif { [[IP::client_addr] eq matchclass lump_o_coal_users] } {

 

rateclass rateshape_128k

 

}

 

else {

 

discard

 

}

 

}

 

}

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Inspecting the XForwarded-For header would be a trivial change as far as the code is concerned, although it would require the association of an HTTP profile with the Virtual the rule is applied to, which could add a slight increase in load.

     

     

    This is probably your best alternative if they are moving to a proxied architecture, as you'll need them to add something to identify the originator of the request so that you can continue seperating the traffic into the appropriate rateclasses.

     

     

    Colin