S
S
SpiritSantos2017-08-17 22:16:48
linux
SpiritSantos, 2017-08-17 22:16:48

How does Linux Traffic Control work?

Good day.
Help clarify bandwidth management on Linux
with "Traffic Control".
There are 2 network cards
eth0 lan
eth1 wan
lan 192.168.1.0/24
It is necessary to distribute 30mbps to each of the network
Rules!
#---------------------------------------------------------------- -----------------------------------------------------#
tc qdisc add dev eth0 root handle 1: htb default 20
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbps ceil 100mbps
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 30mbps
tc qdisc add dev eth0 parent 1 :11 handle 10:0 sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.1.0/24 flowid 1:11
#----------------------- -------------------------------------------------- -----------------------#
From the log :
The "default 20" option says that all traffic not classified by filters should be processed using class "1" disciplines :20". Let's create a root class under which all traffic will fall (this is necessary to implement borrowing):
#------------------------------- -------------------------------------------------- ---------------#
Is this ?
tc class add dev eth0 parent 1:1 classid 1:20 htb rate ??? mbps
tc qdisc add dev eth0 parent 1:20 handle 20:0 sfq perturb 10 What
is the unclassified traffic?
tc filter add dev eth0 protocol ip parent 1:0 prio 1\
u32 match ip src ???????? flowid 1:20
#----------------------------------------------------- -------------------------------------------------- -#
All this construction does not work, the traffic goes without restrictions.
What am I doing wrong and where to dig or what to read?
#---------------------------------------------------------------- -----------------------------------------------------#
And how to do "each of the network distribute 30mbps and if the channel is empty, give everyone the entire channel"?
#---------------------------------------------------------------- -----------------------------------------------------#

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2017-08-18
@leahch

If an academic question, then I would like to look at the full set of rules.
If technical, then I do not understand why work with iptables and tc directly. It's like writing assembly language in the presence of high-level languages. Take for example firehol and fireqos, rules are generated from 5-10 lines! https://firehol.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question