[LARTC] How to limit a dev bandwidth.

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello there,

 : The device is 100M.
 : How to limit it to 1M?

Maybe you wish to use IMQ? [1]

Are you trying to simulate a 1MBit link?

If not IMQ, is this a router, or an endstation?

If a router, using HTB:

  tc qdisc add dev $OUTSIDE root handle 1: htb default 1
  tc class add dev $OUTSIDE parent 1: classid 1:1 htb rate 1Mbit

  tc qdisc add dev $INSIDE  root handle 1: htb default 1
  tc class add dev $INSIDE  parent 1: classid 1:1 htb rate 1Mbit


If an endstation, using HTB and policing:

  tc qdisc add dev $OUTSIDE ingress
  tc filter add dev $OUTSIDE parent ffff: protocol ip \
    u32 match ip src 0.0.0.0/0 flowid :1              \
    police rate 1Mbit mtu 12k burst 10k drop

  tc qdisc add dev $OUTSIDE handle 1: htb default 1
  tc class add dev $OUTSIDE parent 1: classid 1:1 htb rate 1Mbit

-Martin

  [1] http://trash.net/~kaber/imq/

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@xxxxxxxxxxxxxx



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux