LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2007, 06:05 PM   #1
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Rep: Reputation: 18
Question 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
 
Old 06-03-2007, 10:33 AM   #2
FMC
Member
 
Registered: May 2007
Location: São Paulo
Distribution: Gentoo & Debian
Posts: 97

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


[]'s, FMC!
 
Old 06-04-2007, 07:02 AM   #3
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Original Poster
Rep: Reputation: 18
ooooh, thankies dude. i think i'll go through the hard way and see what i can come up with
 
Old 06-04-2007, 08:05 AM   #4
FMC
Member
 
Registered: May 2007
Location: São Paulo
Distribution: Gentoo & Debian
Posts: 97

Rep: Reputation: 15
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!
 
Old 06-04-2007, 09:20 AM   #5
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Original Poster
Rep: Reputation: 18
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
 
Old 06-04-2007, 09:51 AM   #6
FMC
Member
 
Registered: May 2007
Location: São Paulo
Distribution: Gentoo & Debian
Posts: 97

Rep: Reputation: 15
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!
 
Old 06-06-2007, 06:50 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 17.3+18.3, MX-17
Posts: 4,177

Rep: Reputation: Disabled
In case you don't have that already:

http://iptables.rlworkman.net/iptables-tutorial.html
 
Old 08-03-2007, 02:44 AM   #8
ivailo
LQ Newbie
 
Registered: Jun 2007
Location: Bulgaria
Distribution: Debian (etch)
Posts: 5

Rep: Reputation: 0
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.

Last edited by ivailo; 08-03-2007 at 02:48 AM.
 
Old 08-03-2007, 06:26 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,184

Rep: Reputation: 1017Reputation: 1017Reputation: 1017Reputation: 1017Reputation: 1017Reputation: 1017Reputation: 1017Reputation: 1017
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Traffic shaping (limiting outgoing bandwidth of all TCP-traffic except FTP/HTTP) ffkodd Linux - Networking 3 10-25-2008 12:09 AM
Traffic rate limiting per IP on CentOS 5.0? Trionnis Linux - Networking 2 05-17-2007 07:54 AM
Rate limiting with Iptables on port 21 rino2003 Linux - Networking 1 12-26-2004 06:34 PM
logging traffic of specific ports Bug Linux - Security 1 06-15-2004 08:26 AM
Kernel Rate Limiting mikeyt_3333 Linux - Networking 1 10-25-2001 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration