tc

tcコマンドの使い方

タグ tc 帯域制限


概要

  • tc - show / manipulate traffic control settings
  • 帯域制限を行えるソフトウェア
  • 厳密な帯域制限はできずズレが大きい

具体例

ダウンロードの帯域制限

#! /bin/bash

IF="enp14s0"

# ref. googleでの"100 kbit in mb"の結果
LIMIT=300Mbps
BURST=1000Mb

IP=0.0.0.0     # Host IP

tc qdisc del dev ${IF} ingress
tc qdisc add dev ${IF} ingress

tc filter add dev ${IF} protocol ip ingress prio 2 u32 match ip dst 0.0.0.0/0 action police rate ${LIMIT} burst ${BURST}
tc filter add dev ${IF} protocol ip ingress prio 2 u32 match ip src 0.0.0.0/0 action police rate ${LIMIT} burst ${BURST}

アップロードの帯域制限