From 4929b3f0ef3411f863796379834387ee6bacbcf0 Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Sat, 21 Jan 2012 15:42:17 -0800 Subject: [PATCH] Traffic limiter configuration for downlink direction --- traffic-limiter.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/traffic-limiter.txt b/traffic-limiter.txt index 2748375..b78a638 100644 --- a/traffic-limiter.txt +++ b/traffic-limiter.txt @@ -1,12 +1,19 @@ -# Limiting traffic rate to 1mbit to Amazon US-West data center (204.246.0.0/16) +# Limiting outgoing traffic rate to 100 Mbps to Amazon US-West data center +# (204.246.0.0/16) tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 1000mbit tc class add dev eth0 parent 1: classid 1:1 cbq rate 100mbit allot 1500 prio 5 bounded isolated tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dst 204.246.0.0/16 flowid 1:1 +# Limit both incoming traffic as well +tc qdisc add dev eth0 handle ffff: ingress +tc filter add dev eth0 parent ffff: protocol ip prio 16 u32 match ip src 204.246.0.0/16 police rate 100mbit burst 10k drop flowid :1 + # List traffic classifier state tc qdisc show dev eth0 tc class show dev eth0 tc filter show dev eth0 +tc filter show dev eth0 parent ffff: # To clear tc qdisc del dev eth0 root +tc qdisc del dev eth0 ingress -- 2.20.1