Questions tagged [tc]
TC is the linux tool used to manipulate the traffic control functionality in the kernel.
241
questions
0
votes
0
answers
10
views
Traffic control on an interface for all sessions
On an interface that is connected to a 1G port I want to limit all users/sessions to have no more than 20Mbits download speed individually. I mean If two of them tried to use bandwidth at the same ...
-1
votes
0
answers
41
views
TC limit Speed with Multiple Ports [closed]
i have an script that works well for single port limitation writen in bash and works with TC
but imagine each vpn users connects to server with unique port, how can we set speed limit each ?
exp: ...
0
votes
0
answers
23
views
How to set speed limit per IP in IP range in Ubuntu
What I want:
I've setup a openvpn-server and want the clients in range of 10.8.0.0/21 limit their speed to 10mbit for each IP as a total limit of 100mbit.
wan interface : eth0
openvpn interface : ...
1
vote
1
answer
75
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 ...
0
votes
0
answers
110
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/...
0
votes
1
answer
81
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 ...
0
votes
0
answers
48
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 ...
0
votes
0
answers
44
views
How can I have different delays for different IP Addresses using tc and netem?
I have been using tc with netem to delay packets being sent from my computer to a specific IP address. I have managed to get this to work but I would like to have unique packet delays to each IP ...
0
votes
1
answer
466
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 ...
1
vote
1
answer
149
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 ...
0
votes
0
answers
47
views
Traffic control with tc qdisc taprio
Currently, I am working on a TSN project and I am trying to implement a TSN scenario in a Ubuntu 20.04 VM.
I leverage on tc qdisc command:
tc qdisc replace dev gateway-eth0 parent root handle 100 ...
0
votes
0
answers
63
views
TC: link sharing for ingress traffic not working
I was trying to set up an ingress link sharing env. by tc & htb qdisc. and I made two macvlan subinterfaces(say mgmt, data) under a parent physical interface enp8s0f0 and enp8s0f0's speed is 1000 ...
0
votes
0
answers
20
views
Combine netem with pfifo_fast at the root
I am unable to combine netem with pfifo_fast so that at the root I have pfifo_fast and then netem as sub childs on the same interface.
I can afford to run
sudo tc qdisc add dev <interface_name> ...
0
votes
0
answers
69
views
Linux traffic balacning over multiple interfaces using traffic control
I have a server with virtual machines on libvirt. The server has an eth0 external interface. Each virtual machine has its own tap interface (tap0, tap1, tap2, etc.). I need to balance the traffic ...
0
votes
0
answers
81
views
Add delay to local traffic, not on loopback
I have a (Ubuntu 18.04) server with several network interfaces, and one of them is a LAN interface (call it eth1, on server A, with IP address 192.168.0.1). Several servers are on the same LAN.
I ...
0
votes
0
answers
47
views
Limit total bandwidth allocated to outgoing TCP traffic
I have a Linux server, and I would like to reserve some of its bandwidth for UDP traffic only [1]. So I am looking for a way to cap the total bandwidth allocated to TCP traffic to some given constant (...
0
votes
1
answer
149
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:...
1
vote
1
answer
870
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 ...
0
votes
1
answer
382
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, ...
0
votes
1
answer
170
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 ...
0
votes
1
answer
38
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 ...
1
vote
0
answers
154
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 ...
1
vote
0
answers
53
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 ...
1
vote
1
answer
5k
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. ...
1
vote
0
answers
270
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.
# ...
0
votes
1
answer
175
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 ...
1
vote
0
answers
188
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 ...
1
vote
0
answers
205
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 ...
1
vote
1
answer
3k
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
$...
1
vote
1
answer
96
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 ...
2
votes
1
answer
892
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 ...
1
vote
1
answer
944
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-...
2
votes
1
answer
863
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 ...
3
votes
1
answer
2k
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 ...
0
votes
1
answer
609
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 ...
1
vote
0
answers
478
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, ...
2
votes
0
answers
301
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:
$...
2
votes
0
answers
938
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 ...
2
votes
0
answers
642
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 ...
0
votes
1
answer
1k
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.
...
0
votes
1
answer
407
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. ...
0
votes
0
answers
230
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 ...
0
votes
2
answers
415
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 ...
0
votes
1
answer
114
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 ...
2
votes
1
answer
682
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 ...
0
votes
0
answers
88
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 ...
1
vote
1
answer
126
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 ...
1
vote
0
answers
132
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 ...
0
votes
2
answers
153
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 ...
3
votes
1
answer
3k
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#...