Questions tagged [tc]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
223 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
0 votes
1 answer
3k views

What's the differences between "quantum"s in htb and fq_codel qdisc?

According to the manual page HTB quantum how much bytes to serve from leaf at once {use r2q} FQ_Codel quantum It is the number of bytes used as 'deficit' in the fair queuing algorithm. ...
William's user avatar
  • 181
1 vote
0 answers
605 views

tc rule not matching when applied on virtual interface created with Docker

I'm trying to delay traffic between containers (container1 calling container2) from a third container that has access to the host network and having capability NET_ADMIN (container3_admin). When I ...
Nicolas Henneaux's user avatar
3 votes
0 answers
2k views

Using tc qdisc, class, and filter to limit bandwidth (both ingress and egress) based on DSCP marks

I'm looking to set-up traffic shaping program that limits both incoming and outgoing traffic based on 6-bit DSCP field in IPv4 packet header. The user should be able to specify different rates for ...
dooble's user avatar
  • 31
1 vote
1 answer
352 views

tc command does not affect on two processes in a same machine

I am wondering why tc command does not work as expected. I set the command like the following tc qdisc add dev eno0 root handle 1:0 tbf rate 50mbit burst 25kb limit 250kb where I'm expecting ...
user9414424's user avatar
1 vote
1 answer
426 views

tc match IPv4 fragment offset

What is the correct Syntax for matching Fragments that have and Offset > 0 in tc? I have tried: ... u32 match u8 255 ff at 7 flowid 2:1 But to no avail
John's user avatar
  • 11
0 votes
1 answer
1k views

Deleting root pfifo_fast (tc) on Linux

I'm trying to delete all qdiscs to do "fresh" configuration: % tc qdisc del dev enp0s25 root RTNETLINK answers: No such file or directory But it's there: % tc qdisc show qdisc noqueue 0: dev lo ...
LetMeSOThat4U's user avatar
3 votes
1 answer
4k views

Multiqueue tun/tap interface

I am trying to understand how Multiqueue tuntap interface works. Following the instructions provided at: https://www.kernel.org/doc/Documentation/networking/tuntap.txt I was able to create multiple ...
Deys Nima's user avatar
3 votes
0 answers
2k views

Adding some delay to a specific port on localhost using tc and netem

I'm going to simulate a network latency on three different ports of local host by using tc (traffic control for Linux) commands. I run the following code: !/bin/bash tc qdisc add dev lo root handle 1:...
Folani's user avatar
  • 31
1 vote
1 answer
1k views

Revert tc back to original that existed before the tc command?

I did this which worked great to limit my host's bandwidth. But now I want to return to full speed. Sadly my command is not right. ga@ga-EX58-UD4P:~$ sudo tc qdisc add dev eth1 ingress [sudo] ...
Geoffrey Anderson's user avatar
0 votes
1 answer
636 views

Advanced tc filtering flow map for SFQ queue

I'm trying to change the default filtering for a SFQ to one based on source IP, where each IP goes to a class. I know I can create a SFQ with more divisors with something like: tc qdisc add ... sfq ...
Xavier Trilla's user avatar
2 votes
0 answers
4k views

How to undo the effects of a 'tc qdisc change' command?

I am playing with the netem examples from here https://wiki.linuxfoundation.org/networking/netem and I have learned that I can undo the effect of a tc qdisc add command with a similar tc qdisc del ...
AnonymousLurker's user avatar
0 votes
1 answer
199 views

Network shaping local proxy for website testing

I want to make a virtual network interface to TCP-proxy a website and have my browser see it through a slow network connection, in order to debug performance issues in the website itself. So far I ...
dsign's user avatar
  • 153
2 votes
0 answers
144 views

Linux HTB number of levels

Re-modified Linux HTB by adding a single printk message in htb_dequeue function. static struct sk_buff *htb_dequeue(struct Qdisc *sch) { ... original code ... original code for (level = 0;...
Tony Tannous's user avatar
2 votes
1 answer
1k views

tc/netem filter explenation

Iam new to tc and i find it mighty confusing, i was able to find and bit understand little command flow, to issue delay on specific IP, but i dont tink it works properly - delaying all traffic ...
J B's user avatar
  • 93
1 vote
1 answer
426 views

Delaying Server response for specific IPv6 address

I have 3 servers configured with IPv6 address and I want to add some delay to a couple of servers say S1 and S3. For IPv4, I'm using 'tc' command and it's working fine. Commands using for IPv4 ...
metadata's user avatar
  • 121
1 vote
1 answer
148 views

TC- HFSC : Can we have TC rule to set classes with minimum guarantee, but no maximum limit?

Can we set a rule where i can specify that my particular traffic will get minimum b/w no matter what, but no max limit if bandwidth is available. Eg : I have 20 mbps line. i want to set minimum 5 ...
kulhar's user avatar
  • 11
0 votes
0 answers
503 views

Run OpenVPN --learn-address script as root

I am running an OpenVPN server and need to run a bash script whenever a user gets an IP. The script is working fine now that i am running OpenVPN as root, but my intention was to run the server as ...
DomeWTF's user avatar
  • 127
2 votes
1 answer
661 views

Limit traffic on by user OpenVPN server using tc (traffic control)

I run an OpenVPN server with a 1 Gbps bandwidth and I need to limit it to 5 Mbps per user. Searching the internet I've come up to this bash script: $U32 = "tc filter add dev tun0 protocol ip parent ...
DomeWTF's user avatar
  • 127
2 votes
0 answers
471 views

Bandwidth control with TC for clients yet to be connected

I have applied bandwidth control using TC and iptables using this tutorial on my Strongswan VPN server. The bandwidth control works fine ONLY if that specific client is already connected. For example:...
Ajji's user avatar
  • 131
2 votes
1 answer
7k views

Limit packet rate, open connections, and IP addresses

On Linux, can I use tools like tc, iptables or others to control/shape network traffic on a network interface, for the following purposes: Control the network packet number rate (or the total number)....
WindChaser's user avatar
1 vote
1 answer
84 views

htb multiply root rate by 8

I am changing the queue discipline to HTB, creating a parent node, and 3 children which are the classes. sudo tc qdisc add dev em1 root handle 1: htb sudo tc qdisc add dev em1 parent 1: classid 1:1 ...
Tony Tannous's user avatar
1 vote
2 answers
3k views

Why doesn't this "tc filter" rule classify the traffic at intended?

I'm trying to configure some basic traffic classification to limit the maximum ingress bandwidth for every machine in my local network to 3 Mbps. I'm operating the gateway 192.168.2.1, where the ...
ConfusedUser001's user avatar
6 votes
1 answer
5k views

Network shaping using `tc netem` doesn't seem to work

I'm trying to simply delay traffic targeted for certain IP address on Ubuntu 16.06 box with no luck. There are plenty of resources as this this this or this that I studied. I ended up with these two ...
peetonn's user avatar
  • 241
0 votes
2 answers
2k views

How to change HTB rate of a classid?

I have tc htb qdisc setup that looks like 1:0 | 1:1 / \ 1:10 1:11 # tc -s -d class show dev br0 Shows class 1:10 with 1024kbit rate and ceil: class htb 1:10 parent 1:1 ...
papar's user avatar
  • 103
0 votes
1 answer
587 views

tc qdisc with GRE in openwrt

I'm trying to implement traffic control to GRE interface in an openwrt board. For this i followed below steps, Create GRE interface named gre1 in both tunnel end devices. Tested reachability with ...
Shihab Pullissery's user avatar
2 votes
0 answers
66 views

Combining tbf with other qdiscs?

It looks like a subset of classless qdiscs can be combined with each other in certain configurations. In fact it doesn't make sense to me that you could not do this, since things like codel will only ...
jdizzle's user avatar
  • 558
1 vote
0 answers
1k views

tc prio how the packets are prioritized

I want to use tc prio queuing discpline for scheduling packets in a particular order. I want to send out packets to destination port 5555 with the highest priority and packets to destination port 6666 ...
vijaya's user avatar
  • 11
2 votes
1 answer
1k views

How to measure the speed for tc (traffic control) in Ubuntu?

I have the following settings: tc qdisc del dev $ETH0ORSIMILAR root tc qdisc add dev $ETH0ORSIMILAR root handle 1: htb default 30 tc class add dev $ETH0ORSIMILAR parent 1: classid 1:1 htb rate ...
Houman's user avatar
  • 1,675
-2 votes
1 answer
650 views

Linux control packet size for specific IP address

I would like to get Linux tool/script to control packet size of specific IP or MAC. For example if IP reach 10 MB then DROP packages with IP tables. I have idea how to DROP, but I don't have idea how ...
aze2201's user avatar
  • 101
1 vote
0 answers
216 views

force tbf qdisc to drop traffic

I have several virtual netspaces on my server connected via the virtual adapters. One of the connections between the netspaces is limited to 10 Mbps: root@core-wkst:/var/log# tc -s qdisc show dev ...
jpou's user avatar
  • 131
8 votes
0 answers
1k views

How to limit bandwidth per VPN connection?

I have a StrongSwan (IKEv2) server setup and would like to limit each VPN connection to 512kb/s. After researching I came across tc in Ubuntu. I don't quite understand it and am fighting through the ...
Houman's user avatar
  • 1,675
0 votes
1 answer
805 views

Bandwidth shaping for an ipset using qdisc and tc

I am trying to do bandwidth control for an ipset using these tutorials 1,3,21. And this script. I have modified it to get ipsetnames. This is my bandwithshaing script. TC=/sbin/tc IF=wlan0 ...
Sachith Muhandiram's user avatar
0 votes
1 answer
327 views

Limit bandwidth for two sources of traffic together but not one of them

There are 2 sources of traffic The first one of them shouldn't be impeded in any way, it should be able to draw as much available traffic as it wants. The second one, on the other hand, should be ...
Michael Ivko's user avatar
1 vote
1 answer
1k views

How to set an general network limit per client + priority for TCP acknowledgements

Following situation: Network A is connected to network B over an slow connection. Different hosts in network A would like to send traffic to hosts in network B. Hosts in network B sending commands to ...
Mr Mueseli's user avatar
1 vote
1 answer
6k views

I need it simulate a delay to a certain IP over as certain port

I need to simulate a traffic slow down to a certain service. That means I need to slow connection on a certain port. I have this script that introduces a delay to a certain IP on all ports, but other ...
GreenFox's user avatar
  • 111
2 votes
1 answer
446 views

Can Linux queueing discipline solely to lower latency? Can it be disabled?

i'm learning about queueing discipline as part of tuning the network stack on our carbon-c-relay cluster. My understanding is that the queueing discipline layer exists solely to lower latency and ...
Michael Martinez's user avatar
4 votes
0 answers
1k views

Limiting incoming traffic with tc police

I have a requirement to limit the total incoming traffic to 5mbit. I know this can be achieved by using the following tc command: tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 ...
Shihab Pullissery's user avatar
2 votes
0 answers
245 views

Qdisc class for eth0 disappearing

I have a script that sets up traffic shaping on port eth0. The script is as follows: import os import subprocess def run(cmd): print cmd result = subprocess.check_output(cmd, shell=True) ...
user3249763's user avatar
1 vote
0 answers
746 views

Use tc qdisc netem to emulate delay, but ssh gets slow down

I have 3 VMs, A, B, and C. These VMs are all under the same network. On VM A, I use the following commands to introduce a delay to VM B. tc qdisc add dev eth0 root handle 1: prio tc filter add dev ...
Wei-Tsung's user avatar
0 votes
1 answer
852 views

Limit download speed to single LAN IP using TC on router's WAN interface

Currently I police the rate on my download speed with tc filter add dev ppp0 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 9900kbit burst 10k drop flowid :1 I've got one ...
Josh's user avatar
  • 61
1 vote
2 answers
6k views

Traffic shaping with iptables, ipset and tc (--match-set and --set-mark)

I am having some trouble with what I believe should be a fairly straightforward traffic shaping problem. I have an Ubuntu (16.04) server that is acting as a router/nat. I want to allow most users to ...
Gav's user avatar
  • 113
2 votes
1 answer
1k views

tc police rate packets by iptables handle?

I want to limit download speed from any IP to 800kbit, (this works) And I want to limit the download speed of marked packets to 400kbit. I don't get any errors, but it's not limiting the download ...
Josh's user avatar
  • 61
1 vote
1 answer
652 views

shape dropbox on linux router with tc and iptables

Another machine on my LAN is uploading to Dropbox and saturating my internet connection's upload bandwidth. When that happens my pings to 8.8.8.8 take 3000-6000ms. When dropbox is not uploading my ...
Josh's user avatar
  • 61
3 votes
0 answers
2k views

How to configure per IP bandwidth control using TC?

Requirements: There is an arbitrary number of users per group. Bandwidth for any particular group is 1000kbps. Bandwidth for each user in a group is 70 kbps. At any time no user should not consume ...
techiek7's user avatar
1 vote
1 answer
2k views

rate limiting traffic for internal ip (TC)

I have configured ikev2 VPN on my server, but there is no tunnel interfaces like openvpn (tun0). So actually, I can't limit the ikev2 vpn speed using tc tool. Example for traffic shapping of openvpn (...
JohnsonGoey's user avatar
4 votes
1 answer
648 views

Inject Delay between Virtual Machines in a VLAN

We'd like to simulate the impact of locality using VMs within a on a public cloud (say AWS EC2). To do this, we would like to inject delays in packets such that we can simulate a particular network ...
Jedi's user avatar
  • 478
3 votes
2 answers
4k views

How to limit speed for every device per MAC address in the gateway via Linux command "tc"?

I have a gateway whose OS is Linux.Assume my downlink bandwidth is 100 Mbps. I want to limit the max download speed to 1Mbps for every device which uses this gateway.In other words, if there are 100 ...
Shuangfeng He's user avatar
2 votes
1 answer
892 views

LINUX: multiq leaf not replaceable with tc

# uname -r 4.7.5-200.fc24.x86_64+debug # tc -s -d qdisc show dev ens3 qdisc mq 8001: root Sent 44589 bytes 340 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel ...
cherusk's user avatar
  • 41
0 votes
1 answer
376 views

Is it possible to control network traffic per url with TC?

I need to slowdown a specific call to a Web-service but only for a specific url on the same host: I have my program configured to call (GET) URL1 = http://my-remote-system.domain.net:567/...
рüффп's user avatar