Skip to main content

Questions tagged [tc]

Tc is used to configure Traffic Control in the Linux kernel.

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

How to exclude a subnet from TC qdisc rule?

I need to add an artificial delay to outgoing traffic from my server's eth0 interface using the Linux command tc (Traffic Control). I would like to add such a delay to all packets except those ...
Federico Cristofani's user avatar
0 votes
0 answers
21 views

Can tc or nftables change the SA/TA in 802.11 frame?

I am looking for a way to change the SA/TA on a Wi-Fi frame. I need this because I have a VM (running with QEMU and vmnet-bridged) in a MacBook that connects to a Wi-Fi interface, and a laptop ...
amkgi's user avatar
  • 103
0 votes
0 answers
67 views

Traffic control - bandwidth and jitter colidation for Quic

I am currently experimenting with the Quic and TCP protocols, aiming to simulate real network conditions using TC. However, I encountered an issue when attempting to set the bandwidth to 32mbit, with ...
Patrik Nespor's user avatar
1 vote
1 answer
134 views

Traffic shaping ineffective on tun device

I am developing a tunnel application that will provide a low-latency, variable bandwidth link. This will be operating in a system that requires traffic prioritization. However, while traffic towards ...
sheddenizen's user avatar
0 votes
0 answers
240 views

Controlling udp traffic with linux tc command

Setup: A client laptop (mac) connected to a Wi-Fi router wirelessly (atheros NIC with dd-wrt firmware). A server (linux) is directly connected to the router over ethernet interface. Now I am testing ...
SAM's user avatar
  • 1
0 votes
0 answers
41 views

How can I delete just one queue in htb?

I would like to delete just one queue in htb when having two. My script would be the following one: TC=/sbin/tc IF=wlan0 # Interface DNLD=1mbit # DOWNLOAD Limit UPLD=1mbit ...
Nfernandez's user avatar
0 votes
1 answer
79 views

Changing packet payload with tc

How can tc be used to match a particular payload of an ingress packet, e.g., if the first 32 bits of payload of an IP/UDP packet are equal to some constant $c, the value $c should be changed to $d? ...
qemvirt's user avatar
  • 13
1 vote
1 answer
228 views

MAC address rewriting using tc

I am using tc to change the MAC address of incoming packets on a TAP interface (tap0) as follows where mac_org is the MAC address of a guest in a QEMU virtual machine and mac_new is a different MAC ...
qemvirt's user avatar
  • 13
1 vote
1 answer
505 views

Redirect port using TC BPF

I'm want to use TC BPF to redirect incoming traffic from port 80 to port 8080. Below is my own code, but I've also tried the example from man 8 tc-bpf (search for 8080) and I get the same result. #...
greenro's user avatar
  • 13
1 vote
0 answers
228 views

How to set bandwidth limit using linux tc

In my linux router: interface eth1 total bandwidth is 1gbit I want to divide 1140kbit to GroupA, divide 150kbit to GroupB Set users 10.10.10.158, 10.10.21.5, 10.10.21.6 to GroupB Each user has no ...
ackema's user avatar
  • 11
0 votes
2 answers
235 views

Can netfilter act as a DHCP relay?

I'm wondering whether instead of using a DHCP relay netfilter (be that tc or nftables) can be used to route DHCP broadcast packets to a Docker container attached to a bridge. The reasoning for this is ...
Synthetic Ascension's user avatar
0 votes
0 answers
49 views

eBPF program, how to obtain net_device from tc through __sk_buff?

eBPF program, how to obtain net_device from tc through __sk_buff? u32 ifindex = skb->ifindex I can get the ifindex, but how do I convert it to the net_device structure?
boy long's user avatar
0 votes
0 answers
42 views

Can no longer ping containers after setting TBF qdisc on Docker0

I am trying to use the tc command to manipulate traffic on the docker0 interface. I run the commands tc qdisc del dev docker0 root tc qdisc add dev docker0 root handle 1: tbf rate 100mbps burst 1600 ...
akastack's user avatar
1 vote
0 answers
689 views

tc filter - error talking to the kernel

I am trying to add a tc flower filter for the geneve protocol and I am getting this error: % sudo tc filter add dev gnv0 protocol ip parent ffff: \ flower geneve_opts 0108:01:020000000000000000/...
Ollie's user avatar
  • 199
1 vote
1 answer
460 views

How to police ingress (input) packets belonging to a cgroup with iptables and tc?

I am trying to limit the download (ingress) rate for a certain app within a cgroup. I was able to limit the upload (egress) rate successfully by marking app's OUTPUT packets in iptables and then set a ...
user216385's user avatar
0 votes
0 answers
393 views

router command to change bandwidth limit for a MAC address

I use DD-WRT to limit WAN bandwidth to one MAC address using DD-WRT's web interface. The key entry in the web interface (in "NAT/QoS" tab's "QOS" tab) is "MAC priority", ...
bobuhito's user avatar
  • 123
1 vote
1 answer
1k views

Monitoring packet loss simulated with tc

I found an interesting article that describes how to simulate network issues (like lost packets) on a linux server. On an Ubuntu test VM, I checked which interface is used for internet connectivity, ...
BMBM's user avatar
  • 147
0 votes
0 answers
780 views

How to limit Wireguard bandwidth

I have Debian 11 server with installed Wireguard with wg0 interface and 3 peers. Server bandwidth speed is 100 MBit and traffic is around 500 GB per month. What I need is: these 3 peers can use 100 GB/...
Space's user avatar
  • 1
0 votes
0 answers
264 views

When using ipvlan l3, I can't filter packets with iptables

My general intention is to run hypervisor instances in separate network namespaces. I have something that looks promising, but as I dug into trying to make things work with iptables, I found some ...
fdr's user avatar
  • 101
0 votes
1 answer
63 views

How to deterministically vary the delay in programs like netem?

I am trying to set up a network scenario in which there is a variable delay between two nodes. Netem allows to set up a fixed delay and add a jitter according to some probabilistic distribution. ...
rul_h's user avatar
  • 1
1 vote
1 answer
675 views

Using tc netem for dynamic delay variations causes packet loss

I'm trying to use tc netem to simulate a short [0.5, 1.5] second increase in delay in the range [0, 1500ms]. This is done with the command: sudo tc qdisc add dev enp37s0 root netem delay 200ms The ...
Ralf's user avatar
  • 111
4 votes
1 answer
529 views

Why does tc-netem on loopback also affects other interfaces?

I'm trying to modify the network behaviour of my server(s), to simulate external/WAN connection behaviours (what ever that means). After doing tc qdisc add dev lo root netem delay 100ms, I can ...
renyuneyun's user avatar
2 votes
1 answer
2k views

Error when trying to corrupt packets in linux terminal (netem)

The following rule corrupts 5% of the packets by introducing a single bit error at a random offset in the packet: sudo tc qdisc change dev ens8 root netem corrupt 5% But recently it gave me the ...
Arash's user avatar
  • 123
2 votes
0 answers
135 views

How can I perform the same traffic shaping on all transmit queues

I'm trying to use the mq qdisc for performance but I need to add other qdiscs below it to shape traffic. It seems natural to me that one would want the same shaping, regardless of queue and it seems ...
Chris Nelson's user avatar
4 votes
0 answers
2k views

How can I limit bandwidth per connection using tc?

I am pretty new to Linux and tc command and lately I have been looking for a solution to limit bandwidth per connection using the tc command. I have a server application that handles requests from ...
Ben's user avatar
  • 41
1 vote
0 answers
235 views

Add extra latency on top of existing tc qdiscs

On a system with an existing multi-stage qdisc setup, we need to introduce extra latency (at least fixed, but fixed with a small variation would be a nice option to have). The canonical way to do this ...
mirabilos's user avatar
  • 1,752
0 votes
1 answer
565 views

Setting the throughput with TC QDISC affects TCP but no UDP

I am new to tc qdisc and I have been creating a script to change throughput, delay and losses. However, when I try to change the throughput levels I only see an effect on TCP traffic and not on the ...
dgr's user avatar
  • 1
0 votes
0 answers
806 views

Illegal "match" error when applying Linux tc, u32 filters mask

I want apply the following rules for TOS based traffic shaping. All rules works but the final rule which mask the IP header shows illegal "match" error sudo tc qdisc del dev tun0 root handle ...
Javad Rahimi's user avatar
1 vote
1 answer
3k views

How to delay traffic and limit bandwidth at the same time with tc (Traffic Control)?

I want to throttle bandwidth and add delay to a network interface to simulate satellite communication. For example 800ms delay and 1mb/s. The following limits the bandwidth correctly but does not ...
Matebo's user avatar
  • 29
0 votes
0 answers
41 views

Constrain bandwidth on a network interface

I want to limit bandwidth on the wlp2s0 network interface of my laptop. As far as I understood tc, it should be the tool to go. So I tried the following: tc qdisc add dev wlp2s0 root handle 1: htb ...
yujaiyu's user avatar
  • 249
0 votes
0 answers
442 views

tc traffic shaping with HTB and CQB causes packet transmission gap inconsistencies

I am sorry if this is duplicate of https://serverfault.com/q/1076769/822163. I created that first and then realized the Linux and Unix stack exchange is the right place. Problem: When the tc HTB or ...
Chinmaey Shende's user avatar
0 votes
0 answers
366 views

qdisc netem is adding too much delay

I'm running the following command in order to simulate delay + jitter on a veth pair (Mininet). sudo tc qdisc add dev h1-eth0 root netem delay 100ms 5ms When only specifying a 100ms (without the 5ms ...
shellwhale's user avatar
0 votes
0 answers
37 views

Linux Traffic Control (tc) - Enforces Only Average Bandwidth Usage or Also Prevents Spikes

I would like to "level off" bandwidth spikes coming out of Kubernetes pod. Setting Linux tc to 10MB enforces average usage of 10MB or also prevent spikes of over 10MB? Is tc the way to ...
avi's user avatar
  • 1
1 vote
1 answer
2k views

can I use multiple qdiscs per device?

Can I add multiple qdiscs to the same device with tc, or is it only possible to use one qdisc per device? Also, can a qdisc contain child qdiscs, or only child classes? i.e. is it possible to do tc ...
Daniel's user avatar
  • 123
5 votes
2 answers
2k views

Unwanted defragmentation of forwarded ipv4 packets

I want to handle ip fragments in user-space, and I am using the iptables NF_QUEUE to direct packets to user-space. The problem is that IPv4 packets are always re-assembled and delivered as one packet ...
lgekman's user avatar
  • 343
2 votes
1 answer
2k views

Can TC rules persist beyond a reboot? Where?

I am trying to determine whether rules put in place using tc persist beyond a reboot (I do not believe they do by default), and whether there is any way to cause them to persist, or if the best you ...
pooley1994's user avatar
0 votes
0 answers
2k views

Linux tc filter add - errors RTNETLINK answers: Operation not supported

I'm working on the network simulation to create some traffic on specific ports , and trying to inject the network delay. I'm using the linux tc utility to do this operations. So i'm new to the tc ...
karthik's user avatar
1 vote
0 answers
43 views

set asymmetric bandwidth on an interface

I'm coding a simple application using docker-compose and docker networks (images based on ubuntu). One of my services is a client with a network interface given from docker. All my services are on my ...
CodeRonin's user avatar
  • 111
1 vote
1 answer
781 views

Forcefully enable fq_pie

I am very interested in setting up fq_pie queue discipline for TCP congestion control. If I write net.core.default_qdisc = fq_pie to /etc/sysctl.d/90-override.conf, it should enable fq_pie on latest ...
15 Volts's user avatar
  • 2,099
-1 votes
1 answer
2k views

Installing wondershaper on Debian 10

# apt-get install wondershaper # wondershaper wlan0 24000 16000 Now what?! How can I tell if it's running? How can I get it to start automatically after a reboot? (And configure it.) None of the ...
Richard Barraclough's user avatar
0 votes
0 answers
28 views

ESFQ is not control the upload

I am using IMQ and Iptables to control the packages outcome from my LAN using ESFQ, but it is not work at all. How I can control the upload of my LAN, I know that others systems like Mikrotik, has its ...
Kintaro Oe's user avatar
1 vote
1 answer
339 views

How does a htb qdesc tree handle bandwidth overallocation?

let's say I have a simple htb hierarchy (See man 8 tc-htb) set up where the total bandwidth specified for child htb classes exceeds the total bandwidth specified for the root htb class: tc class add ...
Tenders McChiken's user avatar
0 votes
1 answer
785 views

wondershaper bandwdith limit per ip

Does this command allows us to download speed 512kpbs for each connected devices? or let say if two devices connected then they get only 256kbps each or 512 kbps each ? sudo wondershaper wlan0 512
krishna's user avatar
-1 votes
1 answer
154 views

Why does iperf results not change with traffic control change to outbound?

I have been trying to change bandwidth between two ec2 instances using tc and outbound rules using HTB and TBF. I set these rules on on ec2 instance which acts as server and then test from another ...
atticus finch's user avatar
0 votes
1 answer
99 views

Is there a back-pressure mechanism from qdisc to TCP?

Is there a mechanism to stop TCP sending packets towards Qdisc if the queue length exceeds the limit? I know TSQ helps here for a small number of connections but what if I have 1000 connections or ...
Eitan Zahavi's user avatar
0 votes
0 answers
143 views

What is the equivalent tool TC (Traffic Control) for Solaris?

I would like to know if anyone knows a way to emulate what TC does on Linux. I have some scripts that I would like to port to Solaris.
elulcao's user avatar
  • 161
0 votes
0 answers
893 views

Problem of limit bandwidth on a specific port in Ubuntu18.04

I set up a socks proxy server listening on 2 ports, 10001-10002. The port 10001 is provided to anonymous user. So, I want to limit the max bandwidth to 1 MB/s, and limit the max bandwidth of port ...
Jon Xu's user avatar
  • 11
0 votes
0 answers
243 views

Netem does not show the correct parameter inserted

I'm issuing the following tc command tc qdisc in order to configure different queues in a computer. The problem is that when I configure two different queues (htb configuration) and I insert ...
Nfernandez's user avatar
0 votes
0 answers
285 views

egress traffic shaping rules on mirrored interface aren't working

In my small, private, network I have a device (IP address 192.168.0.240) which I want to have a "guaranteed" section of the pipe. To that end, I've been following this Server Fault article to shape ...
Andrew Falanga's user avatar
0 votes
1 answer
980 views

qdisc resets after changing to htb

Background I have a system running Ubuntu which has two interfaces eno1 and enp4s0. I have created an OVS bridge using: ovs-vsctl add br s1 I added the two physical interfaces eno1 and enp4s0 to ...
sbhTWR's user avatar
  • 93