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
0answers
31 views
+50

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 ...
1
vote
0answers
20 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
0answers
28 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
0answers
31 views

tc on openwrt: RTNETLINK answers: No such file or directory

I've just installed OpenWRT release 19.07.2 on this thing: https://openwrt.org/toh/netgear/netgear_r6220 It is meant as a temporary router+firewall for a small network, not as a typical wifi router ...
0
votes
0answers
14 views

TC Netem Delay + PFifo

I'm new to NETEM, I'd like to have some latency between two machines and some jitter, but I don't want packet reordering. I've used the following commands: tc filter add dev eth0 parent 1:0 ...
0
votes
0answers
23 views

Is it possible for limitation and sharing bandwidth in subnet by using htb and assign SFQ on leaf class?

I have a 100mbit link. I have two subnets (192.168.10.0/24, 192.168.20.0/24). I want each of online ip addresses in subnet 192.168.10.0/24 has equal bandwidth. with htb, class, filter, SFQ to this ...
0
votes
0answers
13 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
0answers
124 views

How to limit bandwidth/internet speed per second to each VPN client

I have setup IPsec VPN Server using Libreswan on CentOS 7 and Ubuntu 18.04 both. Now I want to limit internet speed to each connection. I searched on internet and found Linux Traffic Control (TC) and ...
0
votes
0answers
13 views

netem loss when netem is attached to a another class

I have been trying to use netem to simulate packet delay, loss, corruption and duplication. So far I only was able to successfully run delay. All the other operations only worl when netem is the root ...
0
votes
0answers
40 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
2answers
92 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
1answer
33 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 ...
0
votes
0answers
15 views

Filter creation fails for tc

I want to limit network bandwith with traffic control utility (tc), so I'm creating queueing discipline qdisc first, then one class for it and my two target classes with filters 1) tc qdisc add dev ...
2
votes
1answer
54 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
0answers
28 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 ...
0
votes
0answers
58 views

Limit outgoing tcp syn packets

I want to ratelimit outgoing TCP SYN packets to prevent syn floods from local vps customers. Since the vpses use the macvtap driver I cannot use iptables. I have been looking into tc which works but ...
0
votes
0answers
36 views

tc - Simulating Network Latency of Internal Ports (LAN)

I am doing some network simulations on an Ubuntu VM. I am trying to add some latency to all packets being sent to and from specific ports without affecting the whole adapter. The traffic never leaves ...
0
votes
0answers
39 views

Looking to use tc (traffic control) to limit ingress traffic for all but a select few IPs

I have a service that, due to poor security on the part of a large company I don't wish to name, I need to speed limit for unauthorized IPs. While said large company only shows my service to ...
0
votes
0answers
27 views

Prioritize slowest connections? (tc filter, iptables mark)

How could one prioritize the slowest network connections egress traffic in Linux? If one knew avg egress speed of each ip:port connection for at least the last 1 minute, it might be possible to tc ...
1
vote
1answer
85 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 ...
0
votes
0answers
60 views

how to increase priority for upstream packets over downstream?

i tried to capture packets when i download and upload at same time using tcpdump i noticed that downstream packets always takes the priority i want to invert that here are the packets: the ip 172.217....
1
vote
0answers
31 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
2answers
106 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 ...
1
vote
1answer
320 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#...
4
votes
1answer
230 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 ...
2
votes
1answer
162 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
1answer
699 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 ...
0
votes
1answer
155 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
1answer
24 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
1answer
387 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. ...
0
votes
0answers
125 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 ...
1
vote
0answers
323 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
1answer
54 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
1answer
107 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
1answer
301 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 ...
0
votes
1answer
715 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 ...
1
vote
0answers
769 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:...
0
votes
1answer
131 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
1answer
304 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 ...
1
vote
0answers
1k 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
1answer
48 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
0answers
84 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;...
1
vote
1answer
372 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
1answer
158 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
1answer
46 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
0answers
292 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
1answer
247 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
0answers
305 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
2answers
3k 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
1answer
51 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
2 3 4 5