Traffic shaping with tc does not work

Clash Royale CLAN TAG#URR8PPP
I want to limit the outgoing traffic to a specific bandwidth.
My Code:
tc qdisc add dev vif1.0 root handle 1: htb default 30
tc class add dev vif1.0 parent 1: classid 1:1 htb rate 1mbit
tc class add dev vif1.0 parent 1: classid 1:2 htb rate 1mbit
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip dst 91.214.170.249/32 flowid 1:1
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip src 91.214.170.249/32 flowid 1:2
But nothing happens..
I have uploaded a 1GB file and can download it with 4MB/s
vif1.0 is the interface name of my virtual machine
limit tc traffic
|
show 1 more comment
I want to limit the outgoing traffic to a specific bandwidth.
My Code:
tc qdisc add dev vif1.0 root handle 1: htb default 30
tc class add dev vif1.0 parent 1: classid 1:1 htb rate 1mbit
tc class add dev vif1.0 parent 1: classid 1:2 htb rate 1mbit
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip dst 91.214.170.249/32 flowid 1:1
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip src 91.214.170.249/32 flowid 1:2
But nothing happens..
I have uploaded a 1GB file and can download it with 4MB/s
vif1.0 is the interface name of my virtual machine
limit tc traffic
Unclear on which interfacevif1.0is. Is that on the host machine, or the guest? And is the guest the one sending the file?
– derobert
Oct 14 '13 at 15:36
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
1
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23
|
show 1 more comment
I want to limit the outgoing traffic to a specific bandwidth.
My Code:
tc qdisc add dev vif1.0 root handle 1: htb default 30
tc class add dev vif1.0 parent 1: classid 1:1 htb rate 1mbit
tc class add dev vif1.0 parent 1: classid 1:2 htb rate 1mbit
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip dst 91.214.170.249/32 flowid 1:1
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip src 91.214.170.249/32 flowid 1:2
But nothing happens..
I have uploaded a 1GB file and can download it with 4MB/s
vif1.0 is the interface name of my virtual machine
limit tc traffic
I want to limit the outgoing traffic to a specific bandwidth.
My Code:
tc qdisc add dev vif1.0 root handle 1: htb default 30
tc class add dev vif1.0 parent 1: classid 1:1 htb rate 1mbit
tc class add dev vif1.0 parent 1: classid 1:2 htb rate 1mbit
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip dst 91.214.170.249/32 flowid 1:1
tc filter add dev vif1.0 protocol ip parent 1:0 prio 1 u32 match ip src 91.214.170.249/32 flowid 1:2
But nothing happens..
I have uploaded a 1GB file and can download it with 4MB/s
vif1.0 is the interface name of my virtual machine
limit tc traffic
limit tc traffic
asked Oct 14 '13 at 14:51
VinceVince
283210
283210
Unclear on which interfacevif1.0is. Is that on the host machine, or the guest? And is the guest the one sending the file?
– derobert
Oct 14 '13 at 15:36
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
1
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23
|
show 1 more comment
Unclear on which interfacevif1.0is. Is that on the host machine, or the guest? And is the guest the one sending the file?
– derobert
Oct 14 '13 at 15:36
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
1
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23
Unclear on which interface
vif1.0 is. Is that on the host machine, or the guest? And is the guest the one sending the file?– derobert
Oct 14 '13 at 15:36
Unclear on which interface
vif1.0 is. Is that on the host machine, or the guest? And is the guest the one sending the file?– derobert
Oct 14 '13 at 15:36
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
1
1
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23
|
show 1 more comment
1 Answer
1
active
oldest
votes
Solved by OP in the comments:
I have added the interface peth1 to a class (peth1 is the bridge for eth1. so the traffic goes: vif1.0 --> peth1 --> eth1 --> internet). Then a new filter:
tc filter add dev peth1 parent 1: protocol ip prio 16 u32 match ip src xxx.xxx.xxx.xxx flowid 1:1
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96005%2ftraffic-shaping-with-tc-does-not-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Solved by OP in the comments:
I have added the interface peth1 to a class (peth1 is the bridge for eth1. so the traffic goes: vif1.0 --> peth1 --> eth1 --> internet). Then a new filter:
tc filter add dev peth1 parent 1: protocol ip prio 16 u32 match ip src xxx.xxx.xxx.xxx flowid 1:1
add a comment |
Solved by OP in the comments:
I have added the interface peth1 to a class (peth1 is the bridge for eth1. so the traffic goes: vif1.0 --> peth1 --> eth1 --> internet). Then a new filter:
tc filter add dev peth1 parent 1: protocol ip prio 16 u32 match ip src xxx.xxx.xxx.xxx flowid 1:1
add a comment |
Solved by OP in the comments:
I have added the interface peth1 to a class (peth1 is the bridge for eth1. so the traffic goes: vif1.0 --> peth1 --> eth1 --> internet). Then a new filter:
tc filter add dev peth1 parent 1: protocol ip prio 16 u32 match ip src xxx.xxx.xxx.xxx flowid 1:1
Solved by OP in the comments:
I have added the interface peth1 to a class (peth1 is the bridge for eth1. so the traffic goes: vif1.0 --> peth1 --> eth1 --> internet). Then a new filter:
tc filter add dev peth1 parent 1: protocol ip prio 16 u32 match ip src xxx.xxx.xxx.xxx flowid 1:1
answered Aug 11 '17 at 8:40
M KM K
164
164
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f96005%2ftraffic-shaping-with-tc-does-not-work%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Unclear on which interface
vif1.0is. Is that on the host machine, or the guest? And is the guest the one sending the file?– derobert
Oct 14 '13 at 15:36
@derobert Yes, the interface vif1.0 is on the host machine. i have a webserver on my guest machine. i download the file from it (--> outgoing) or upload a file to the guest machine (--> incoming)
– Vince
Oct 14 '13 at 20:27
1
the HTB needs to be on an interface where there is a packet queue. So that'd be the outgoing interface on the guest (assuming you're downloading to the VM host machine). [And assuming it works at all on a virtual interface, not sure.]
– derobert
Oct 14 '13 at 20:39
@derobert interface eth1 is the whole internet. and all other interfaces (vif1.0 too) goes over eth1 to the internet.. so what is the problem with my configuration? :/
– Vince
Oct 15 '13 at 12:16
It sounds like the traffic is coming in to your host machine over vif1.0, but htb works on traffic going out of an interface.
– derobert
Oct 15 '13 at 13:23