Skip to main content

Questions tagged [tc]

TC is the linux tool used to manipulate the traffic control functionality in the kernel.

Filter by
Sorted by
Tagged with
1 vote
2 answers
141 views

Limit bandwidth of a physical interface, turn a 10G link into a 1G link

I want a given network card to behave as if it were a slower network card. Like if the 1G interface in my laptop would actually be a 100M or 10M interface. One way of doing that is of course dig out ...
olh's user avatar
  • 23
0 votes
2 answers
276 views

Both incoming and outgoing packets is delayed even though i target incoming only with tc command

I want to deay incoming packets from a particular ip with tc command. I tried sudo tc qdisc add dev eth0 root handle 1: prio sudo tc qdisc add dev eth0 parent 1:3 handle 10: netem delay 500ms sudo tc ...
JustSomeFool's user avatar
0 votes
2 answers
101 views

Share bandwidth equally

I have a server with 100 Mbps bandwidth. Clients with dynamic IPs could connect to web server and download large files There are maximum 10 clients which can download simultaneously And I guarantee 10 ...
pirojnoe's user avatar
0 votes
1 answer
226 views

How to handle QoS(traffic control) based on physical interface of virtual bridge?

I have a requirement to limit the traffic rate based on different interfaces of the router, such as controlling the upload speed of ssid1 to 10mbps, download speed to 20mbps, lan1 upload speed to ...
Ryan.Ran's user avatar
0 votes
0 answers
93 views

Ingress traffic shaping with OVS port

I have a ovs topology like this: h1 | | [SW 1] / \ / \ [SW 2] [SW 3] \ / \ / [SW 4] | | h2 Traffic is sent ...
Hai Pham's user avatar
1 vote
1 answer
212 views

Using cgroup & tc in linux seems to NOT apply exactly my rates: 10x discrepancy

I'm using the "standard" way that I found everywhere on the internet (including ServerFault) to try and limit the bandwidth of a process, using cgroups & tc. What I see in practice is ...
Gui13's user avatar
  • 43
1 vote
0 answers
803 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
  • 11
0 votes
1 answer
497 views

linux tc + vlan interface

This is my tc simple script. It limit bandwidth based on source ip address and use hashing filter based on /24 subnet. This example filter works but only when this example subnet 10.118.0.0/24 is add ...
PawelZ's user avatar
  • 1
0 votes
0 answers
289 views

Any way to limit bandwidth per IP in network behind linux router

I whant to limit bandwith of clients from network behind my linux based NAT gateway. My clints is connected via wifi or directly via ethernet to router and receiving their IP address from DHCP. I want ...
Spider's user avatar
  • 101
0 votes
1 answer
2k views

Limit bandwidth for incoming packets to specific ip and port

I have a Linux server application running on a specific IP and PORT. Incoming packets need to be manipulated and put into an nfqueue based on sources and ports, for example: iptables -t raw -A ...
seq16's user avatar
  • 1
2 votes
1 answer
875 views

Linux Traffic Control: What is the difference between qdisc multiq and mq?

By default Linux creates a qdisc mq. I am configuring it on my computer to change some parameters but I found that there are 2 qdiscs that seem to be the same: mq and multiq. I can't find any ...
Juan Simón's user avatar
0 votes
1 answer
290 views

Huge lag with linux Traffic Control - TBF failed?

I've been working with Ubuntu18.04 and trying to shape the traffic with linux tc. Things went well in the passed few months. Here's my commands: # init queue sudo tc qdisc add dev enp2s0 root handle 1:...
MingXuan Yan's user avatar
2 votes
1 answer
2k views

How to apply `fq_codel` to balance traffic in multiple VLAN connections?

I have an Ubuntu server connected to multiple VLAN networks over a single physical 1 Gbps network port. The network connections are configured via /etc/network/interfaces like this: auto lo iface lo ...
Mikko Rantalainen's user avatar
0 votes
1 answer
852 views

HTB "rate" parameter limits available bandwidth

Good day, I have the following situation: 4 TCP streams of data from one machine to another. Each streams has its own destination TCP Port. 4 streams have different priorities : high, medium, low, ...
Hadarelv's user avatar
0 votes
1 answer
256 views

Where does u32 packet classifier start

I have a functioning traffic classifier that uses raw packet offsets to match on the source and/or destination MAC addresses of the packet. The filter uses negative offsets as the default appears to ...
axon's user avatar
  • 163
0 votes
1 answer
67 views

Which values for Netem to emulate WAN?

I am developing a distributed application, which I'm currently running on a cluster of Ubuntu VMs over LAN. I'd like to evaluate the performance of my application over WAN. So I decided to use Netem ...
ePezhman's user avatar
1 vote
0 answers
206 views

tc prio qdisc example not working

I'm used tc to priority send packets to port 9999. tc qdisc add dev eno1 root handle 1: prio priomap 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 tc filter add dev eno1 protocol ip parent 1: prio 0 u32 match ip ...
hello's user avatar
  • 11
1 vote
0 answers
165 views

How to see contents of output queue of NIC in Linux and introspect frame delay

I am experimenting with tc tool to implement prioritization of specific data coming from my computer and would like to see exatly how the frames are scheduled and how much time they spend in the qdisc ...
Hadarelv's user avatar
1 vote
1 answer
7k views

WireGuard: Limiting download & upload bandwidth

I'm trying to limit download and upload speed of each wireguard peer to 512kbit. The problem is that my following commands, only limits download bandwidth of peer and doesn't limit upload bandwidth. ...
user3411911's user avatar
1 vote
0 answers
362 views

Dynamic bandwidth in Tc (Bandwidth Changes over time)

Basically I wanted to change the bandwidth after every 10 seconds using tc. So how to do that thing in tc. This is my script. !/bin/bash # # tc uses the following units when passed as a parameter. # ...
Abhishek Chapla's user avatar
0 votes
1 answer
322 views

TC Corruption of Packets Ingress

I’m new to tc & this may be naive question but correct me if I’m wrong tc qdisc change dev eth0 root netem corrupt 5% Does above command corrupt ingress packets only ? If Yes, does outgress ...
Genie's user avatar
  • 13
1 vote
0 answers
251 views

Why the CLASSIFY action isn't applied by the iptables?

Why might the following simple iptables rule not work: iptables -t mangle -A POSTROUTING -p tcp --dport 1194 -j CLASSIFY --set-class 1:10 ? I'm trying to prioritize outgoing traffic to VPN. I am ...
Serge Roussak's user avatar
1 vote
0 answers
268 views

How can I limit incoming/outgoing connection speeds based off IPs?

I want to limit the speed each IP can download/upload files for every application on my server to 1Mb/s Example IP 192.168.0.1 is downloading at sustained 900Kb/s through FTP server if the IP then ...
Toodarday's user avatar
  • 245
2 votes
1 answer
4k views

traffic control (tc) filter not working

i am using Debian and am trying to limit the upload-bandwidth on an ip basis. The configuration is the following: #!/bin/bash tc=/sbin/tc $tc qdisc del dev eth0 root 2> /dev/null > /dev/null $...
Christian's user avatar
  • 141
1 vote
1 answer
166 views

Does tc guarantee network bandwidth for a process or run as best effort?

I have a tc rule as follows: qdisc tbf 1: dev bwp93ce2ea9d929 root refcnt 2 rate 100Mbit burst 100Kb lat 25.0ms Is this rule guarantee network bandwidth to be 100Mbps or it'll throttle if not enough ...
Michel Gokan Khan's user avatar
2 votes
1 answer
2k views

linux traffic control qdisc mq pfifo_fast: where to put netem?

When I list out the qdiscs on my system, I see an mq qdisc and some pfifo_fast qdiscs. The pfifo_fast ones all seem to have a major number that is the same as their parent. Or am I misunderstanding ...
Brenda J. Butler's user avatar
1 vote
1 answer
2k views

Reduce the network traffic priority in Linux

I want to reduce the priority of specific network traffic using tc in particular tc-u32 in my Linux server. In other words all other traffic must have higher priority than traffic with specified IP-...
red0ct's user avatar
  • 404
2 votes
1 answer
1k views

Linux traffic control u32 hashtable filters based on MAC address

I am currently working with a traffic shaping Linux node. The rule set has grown to about 2500 hosts, all identified specifically by MAC address. The filter configuration is "basic", meaning ...
axon's user avatar
  • 163
3 votes
1 answer
3k views

tc: one qdisc for two classes (multiqueue)

The default tc configuration on my server is: # tc class show dev ens5 class mq :1 root class mq :2 root # tc qdisc show dev ens5 qdisc mq 0: root qdisc fq 0: parent :2 limit 10000p flow_limit 100p ...
Vasili Syrakis's user avatar
0 votes
1 answer
920 views

Why does my bond interface with multiq ignore tc's queue selection?

On Debian Buster, Kernel 5.4.51, I have two interfaces tap0 and tap1 joined in a bond interface in mode balance-xor to increase throughput. There is, however, some traffic that must be sent through ...
RenWal's user avatar
  • 21
1 vote
0 answers
596 views

limit bandwidth per IP Linux ubuntu openVPN

I am a newmember in config ubuntu server and I installed an OpenVPN on a ubuntu 18.04 linux server, now I want to limit the server bandwidth with 2Mbit per IP for users that connect to the OpenVPN, ...
mohsen's user avatar
  • 113
2 votes
0 answers
453 views

tc filter does not apply between a virtual interface and a physical one

I am working on a project aiming at managing a network between several components. For project purpose, we want to test some bad network effects using netem. The used commands are the following ones: $...
Nicolas Brax's user avatar
2 votes
0 answers
1k views

Using tc to delay packets to several ports

After reading several pages like this this and without having a really deep knowledge about the kernel Linux, I am able to filter up to 3 ports using just the three first leaves of the tree. tc qdisc ...
David_helo's user avatar
2 votes
0 answers
855 views

TC Filter With BPF and NFTables Packet Marking

I made a TC BPF ingress program and I want it to process specific packets only marked by NFTables. Here's my NFTables table that marks the specific packets: table ip compressor_tc { chain ...
Christian Deacon's user avatar
0 votes
1 answer
2k views

how to proritize UDP port in tc

I have this TC code sudo tc qdisc add dev eth0 root handle 1: prio sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport xxxx 0xffff flowid 1:1 where XXXX is the port number. ...
striker69's user avatar
0 votes
1 answer
590 views

Measure packet latency / drop between ingress and egress interface of a rate-limiting pass-through host

Somewhere between my sender and receiver, there is host explicitly limiting my transfer rate. I know it's a Linux host. The ingress interface for my traffic is eth0 and the egress interface is eth1. ...
rikinet's user avatar
  • 33
0 votes
0 answers
363 views

how to apply TC htb class to each of IPs in an IP range separately?

I use HTB for TC and mark packets with iptables. First I mark a range of IPs (like 192.168.1.0/24). Now I want to apply a htb class to each of these IPs separately. If I add a class and a filter for ...
amirhossein nasseri's user avatar
0 votes
2 answers
539 views

Configuring NAT with Traffic Control for Nginx/Apache on localhost, cache miss

Apache is on 127.0.100.2 and Nginx is on 127.0.100.3, with Traffic Control performing DNAT from the former to the latter (for source 127.0.0.1) and SNAT from the latter to the former (for destination ...
user2768's user avatar
0 votes
1 answer
142 views

Using tc filter together with Snort

I need to add delay to packets after doing some modification using the SNORT inline module. However, I cannot seem to get the packets to match a filter using tc filter ... It always matches the ...
Chamara's user avatar
2 votes
1 answer
835 views

Unable to set bandwidth limit on ingress wireless interface with netem and ifb

I am trying to limit the bandwidth on the ingress of a wireless interface using an IFB virtual interface. I followed the instructions here Summary of the steps: Bringing up ifb: sudo modprobe ifb ...
bobsaccamano's user avatar
0 votes
0 answers
125 views

How configurable is the Linux Network Emulator in regards to queue disciplines?

Based on this wiki article https://wiki.archlinux.org/index.php/Advanced_traffic_control It appears that I can configure the Linux traffic controller, which seems to be a subset of the Linux Network ...
John Mancini's user avatar
1 vote
1 answer
153 views

Performing tasks and custom logic on network packets

I'm looking for a way to process packets in a Linux server in a particular fashion - I need to run some custom logic on every packet, then (possibly) take some actions on the packets and let the ...
FitzChivalry's user avatar
1 vote
0 answers
270 views

Why does adding a single class to the htb qdisc in tc slow down my connection?

I'm running tc with the command: sudo tc qdisc add dev eth0 root handle 1: htb default 1. I then proceed to add a single class like so: sudo tc class add dev eth0 parent 1:0 classid 1:1 htb rate ...
Raiden Worley's user avatar
0 votes
2 answers
181 views

Traffic Control - is it possible to distinguish between www browsing and www bulk (iso download) traffic?

Lately i was working on uploading big files to website, this upload eat whole bandwidth and crippled my network. So i implemented chunking one 1MB chunk per second and its working but now I'm thinking ...
Abc Xyz's user avatar
  • 618
3 votes
1 answer
5k views

How to remove the ingress delay introduced using tc

I learned that we can introduce delay to ingress packets using tc by following the commands specified in : https://wiki.linuxfoundation.org/networking/netem#...
Dinesh's user avatar
  • 171
5 votes
1 answer
2k views

Using tc to decrease bandwidth to a specific destination address

I am trying to find the shortest path between two hosts H1 and H2 using Dijkstra code. Setting a condition in one of the switches on that path. the condition is: if the packet sending to H2 then ...
a66a's user avatar
  • 53
2 votes
1 answer
725 views

Attempting to shape traffic for both IPv4 and IPv6 results in a conflict

On my server I'm attempting to set up traffic shaping, and if I'm doing it for either IPv4 or IPv6, things are just fine: All filter rules for that particular protocol are installed. However, when ...
Robidu's user avatar
  • 157
1 vote
1 answer
3k views

Link bandwidth limiting by using tc

I am a newbie network engineer. I am trying to understand the Linux command tc. I made a simple network, consisting of two hosts H1, H2 and a switch S1 connecting them by using Mininet. Then, I ...
nimdrak's user avatar
  • 139
1 vote
1 answer
454 views

throttle outgoing linux network traffic under high latency

I want to slow my outgoing traffic when it encounters congestion, and measure "congestion" by packet response times. The intent is to avoid one NFS client starving all the other clients when ...
bukzor's user avatar
  • 263
0 votes
1 answer
253 views

Where can I place tc filters?

I have a raspberry pi router for me and my room mates. The bandwidth is divided as follow: 1:0(htb) | 1:1(16mbit/s) / \ 1:2(8mbit/s) 1:ffff(8mbit/s) If I ...
William's user avatar
  • 181

1
2 3 4 5