Linux Networking – How to Throttle Bandwidth on a Network Interface

bandwidthlinuxnetworking

Is there a way to constrain the bandwidth on a NIC in linux? I'd like to be able to simulate an arbitrarily slow connection.

Best Answer

The netem kernel module, controlled by iproute.

You need to compile Netem with the kernel:

Networking -->
   Networking Options -->
     QoS and/or fair queuing -->
        Network emulator

Once the netem module loaded, iproute's tc allows you things like:

tc qdisc add dev  tap0 root netem delay 50ms loss 50% 

(50 % packet loss, extra delay of 50 ms)

Related Question