LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   traffic rate limiting on specific ports. (https://www.linuxquestions.org/questions/linux-networking-3/traffic-rate-limiting-on-specific-ports-558699/)

zidane_tribal 06-02-2007 06:05 PM

traffic rate limiting on specific ports.
 
hi all.

hopefully a quick question. i keep lagging out my connection by flooding it with traffic on port 119. in short, i would like to be able to limit the traffic rate on this port. i.e i have a 2meg/s downstream, i would like to limit traffic on port 119 to 1.5meg/s.

currently i'm using an ipcop firewall to manage my dsl connection and handle the network services (dhcp, dns, ntp etc), however i am building a new hand-built firewall and i would quite like to include this capability.

does anyone have any suggestions on how to acheive this? a pointer to a howto or suggestions on appropriate software would be appreciated rather than pre-written commands, i like to get my hands dirty and tinker until i learn what i am doing rather than just copying commands.

Thanks in advance :)

FMC 06-03-2007 10:33 AM

Easy way: CBQ
Hard (not that hard) and GOOD way: HTB http://tldp.org/HOWTO/Traffic-Control-tcng-HTB-HOWTO/


[]'s, FMC!

zidane_tribal 06-04-2007 07:02 AM

ooooh, thankies dude. i think i'll go through the hard way and see what i can come up with :)

FMC 06-04-2007 08:05 AM

Just another tip, if you realy want to do the HARD way, you can use IMQ... this piece of software is not for every situation, but in some cases its the only way.

I know the actual kernel module keeper of IMQ, an advice that he gave me is: "If you want to use it, be sure you NEED it"!

[]īs, FMC!

zidane_tribal 06-04-2007 09:20 AM

hehe, its not so much doing it the hard way that i am after, if anything easier is better, its my first time after all. i just like to understand what i am doing and i know the tldp is usually pretty good at explaining what you are doing, rather than just lists of "copy and paste this, it will work". its not an essential need, its more just for convenience on my home network. its better to learn it than copy it.

someone once said "mans greatest evolution was the ability to learn", i just like fiddling around with my network, and linux is just the tool for the job :)

FMC 06-04-2007 09:51 AM

Quote:

Originally Posted by zidane_tribal
hehe, its not so much doing it the hard way that i am after, if anything easier is better, its my first time after all. i just like to understand what i am doing and i know the tldp is usually pretty good at explaining what you are doing, rather than just lists of "copy and paste this, it will work". its not an essential need, its more just for convenience on my home network. its better to learn it than copy it.

someone once said "mans greatest evolution was the ability to learn", i just like fiddling around with my network, and linux is just the tool for the job :)

"The hard part is to learn how to read, all other parts are written!"
This is a good one too. (translated from pt-BR)

Well, traffic shapping is a good thing to study, but sometimes its not that easy at the beggining.

If you just need to limit out some ports on your SOHO I believe that HTB is what you realy need, dont try IMQ for this purpose, but be aware that it exists, some day you might need it!

[]īs, FMC!

JZL240I-U 06-06-2007 06:50 AM

In case you don't have that already:

http://iptables.rlworkman.net/iptables-tutorial.html

ivailo 08-03-2007 02:44 AM

Do you happen to know how can I use tcng and do I need it, because I also want to shape my traffic. I heard it is a good way for limiting and all, but I have some problems with the tc output. So does it worth the effort to learn how to operate with it?

Thanks in advance :)

P.S. If someone wants to take a loot at my script and tell me what's wrong with it, I'll be very grateful.

jlinkels 08-03-2007 06:26 AM

Remember that you only can shape traffic on OUTgoing interfaces. That is, if your traffic shaping box is something between the DSL and your clients then it is OK. But if the traffic shaping box IS the device which consumes the bandwidth and you want to shape that, you'd need IMQ.

IMQ is a virtual device inside your traffic shaping box which talks to DSL on one side, and to your box internal on the other side. In other words, you have traffic flowing out of IMQ into your box. With that you have an outgoing connection again which you can traffic shape.

Traffic shaping is not difficult, once you got the hang of it. It is not generally neccesary to use tcng. In tc there are only a few statements which matter and which you have to learn. Preferable you let it work in concert with IPTables and the --mark target. It is the easiest to manage.

jlinkels


All times are GMT -5. The time now is 07:28 PM.