Questions tagged [tc]
TC is the linux tool used to manipulate the traffic control functionality in the kernel.
240
questions
2
votes
1
answer
581
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 ...
0
votes
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 ...
1
vote
1
answer
414
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 ...
0
votes
1
answer
172
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 ...
0
votes
1
answer
2k
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. ...
1
vote
0
answers
564
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 ...
2
votes
0
answers
1k
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 ...
1
vote
1
answer
285
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 ...
1
vote
1
answer
381
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
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 ...
3
votes
1
answer
3k
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 ...
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:...
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] ...
0
votes
1
answer
570
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 ...
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 ...
0
votes
1
answer
162
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 ...
2
votes
0
answers
135
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;...
2
votes
1
answer
965
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 ...
1
vote
1
answer
366
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 ...
1
vote
1
answer
144
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 ...
0
votes
0
answers
480
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 ...
2
votes
1
answer
607
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 ...
2
votes
0
answers
457
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:...
2
votes
1
answer
6k
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)....
1
vote
1
answer
83
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 ...
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 ...
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 ...
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 ...
0
votes
1
answer
569
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 ...
2
votes
0
answers
65
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 ...
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 ...
2
votes
1
answer
986
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 ...
-2
votes
1
answer
635
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 ...
1
vote
0
answers
203
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 ...
7
votes
0
answers
921
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 ...
0
votes
1
answer
750
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 ...
0
votes
1
answer
312
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 ...
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 ...
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 ...
2
votes
1
answer
397
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 ...
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 ...
2
votes
0
answers
221
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)
...
1
vote
0
answers
714
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 ...
0
votes
1
answer
827
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 ...
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 ...
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 ...
1
vote
1
answer
645
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 ...
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 ...
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 (...
4
votes
1
answer
591
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 ...