Traffic shaping with tc does not work

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















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










share|improve this question






















  • 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






  • 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















4















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










share|improve this question






















  • 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






  • 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













4












4








4








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










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 14 '13 at 14:51









VinceVince

283210




283210












  • 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






  • 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











  • @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










1 Answer
1






active

oldest

votes


















0














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







share|improve this answer






















    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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







    share|improve this answer



























      0














      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







      share|improve this answer

























        0












        0








        0







        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







        share|improve this answer













        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








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 11 '17 at 8:40









        M KM K

        164




        164



























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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






            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)