/
netem and iproute2 with tc
netem and iproute2 with tc
traffic control of tc in linux and netem
tc qdisc Linux Traffic Control or tc
Test | |
---|---|
tc qdisc change dev eth0 root netem loss 10% delay 100ms
| |
sudo -i for i in {1..10}; do echo "Ping attempt $i:"; ping -c 100 -f -q 8.8.8.8; echo -e "\n"; done | |
Result | |
on Alpine | |
add package | apk update |
apk for alpine based on busybox | |
kernel module | |
load | modprobe sch_netem modprobe cls_u32 |
check | lsmod | grep netem |
permanent | Not needed !!! |
create file | vi /etc/local.d/netem.start tc qdisc change dev eth0 root netem xxxxxxxx |
chmod +x /etc/local.d/netem.start rc-update add local | |
latency | |
+ 100 ms | tc qdisc add dev eth0 root netem delay 100ms |
remote it | tc qdisc del dev eth0 root |
packet loss | |
+ 10% | tc qdisc add dev eth0 root netem loss 10% |
tc qdisc change dev eth0 root netem loss 10% | |
tc qdisc del dev eth0 root | |
duplication | |
sudo tc qdisc add dev eth0 root netem duplicate 10% | |
reordering | |
sudo tc qdisc add dev eth0 root netem reorder 25% 50% | |
| |
show | |
alpine:~# tc qdisc show qdisc noqueue 0: dev lo root refcnt 2 qdisc netem 8001: dev eth0 root refcnt 2 limit 1000 loss 10% qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 | |
| |
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Each number corresponds to a ToS value (0–7) and maps it to one of the priority bands:
|
, multiple selections available,
Related content
firewall filter for tcp traceroute
firewall filter for tcp traceroute
More like this
tc qdisc Linux Traffic Control or tc
tc qdisc Linux Traffic Control or tc
More like this
ip route and static route
ip route and static route
More like this
FRRouting Free Range Routing or Zebra
FRRouting Free Range Routing or Zebra
More like this
queues or Traffic Class on the Egress Device Interface.
queues or Traffic Class on the Egress Device Interface.
More like this
packet size tx and Rx and QoS queues
packet size tx and Rx and QoS queues
More like this