Forum Discussion
bboyjnr_8532
Nov 09, 2011Cirrus
iRule to calculate client bandwidth usage
hi all,
Just wondered if there was a way to calculate user/client bandwidth per VS and then apply a rateclass when a limit is reached?
I think this can be done with an iRule but no...
nitass
Nov 09, 2011Employee
just wondering whether you have seen this one. would it be applicable?
Simple traffic shaping by JackofallTrades
http://devcentral.f5.com/wiki/iRules.Simple_traffic_shaping.ashx
e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.65.152:http
ip protocol tcp
rules myrule
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
set srvAge [IP::stats age]
set srvBytes [IP::stats bytes in]
if {$srvAge > 10000 } {
if {$srvBytes > 3000000 } {
rateclass bandHog
TCP::release
log local0. "Bandwidth Hog: [IP::client_addr] server bytes $srvBytes"
return
}
}
TCP::release
TCP::collect
}
}
[root@ve1023:Active] config b rate class list
rate class bandHog {
rate 1Mbps
ceiling 1Mbps
drop policy tail
type sfq
}
[root@ve1023:Active] config tail -f /var/log/ltm
Nov 9 05:53:41 local/tmm info tmm[4766]: Rule myrule : Bandwidth Hog: 192.168.206.102 server bytes 137926996
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