LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-03-2004, 03:58 AM   #1
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Rep: Reputation: 0
Unhappy limiting bandwith for a certain port


Hi, I set my linux box with squid and cbq, my iptables redirect all the http request to squid. I'm using cbq to limit ftp, kazaa etc. now the problem is ; I found some website which have a ftp link to download files using ramdom port number, my iptables cannot redirect the port so it eatup my bandwith, I tried to use cbq to limit other ports but keep dissapoint with the result as the website will always using different port and cbq won't be able handle it.

can anyone help me with this, for sure what I need is to limit port except http port (80) and also to keep everyone using irc smoothly...

please help.. thanks..
 
Old 06-03-2004, 10:42 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i hope the following link can help u
http://www.szabilinux.hu/bandwidth/

try to mark ftp packets with iptables.

if it works let me know please. cos i didnt try that before.
 
Old 06-03-2004, 10:22 PM   #3
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Original Poster
Rep: Reputation: 0
thanks.. I've seen the website before I'm posting my question, and still trying to make it works, I'm still newbie so it's gonna takes time for me to try..

but if anyone know how to do it in easier way like using cbq please let me know.. thanks again
 
Old 06-04-2004, 01:29 AM   #4
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i didnt use cbq be4. but nowadays im searching about user based bandwidth limiting. but there is something about ftp and cbq at http://www.tldp.org/HOWTO/Bandwidth-...HOWTO/cbq.html
 
Old 06-04-2004, 08:30 AM   #5
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Original Poster
Rep: Reputation: 0
-

Last edited by dadi; 06-04-2004 at 08:52 AM.
 
Old 06-04-2004, 08:51 AM   #6
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Original Poster
Rep: Reputation: 0
thanks for your suggestion.. hmmm let me explain my question more clearly ; I've installed squid with delay pools so it will limit all downloading files with .exe .zip etc extension, since squid can not limit ftp port then I set cbq to limit port 21 and 22 (I set kazaa's etc. port with cbq as well). Now my problem is theres some website (ie. mysql.com) which provide link to download via ftp, I found it download from port 1339 (which in this case I'm not set the cbq to limit the port) then I stop the the progress and set the cbq to limit any traffic through 1339 port, when it setted I reopen the website and click the same link to download the files, voila.. now it downloading through 2883 port.. and again the cbq can not handle it..

I don't want to limit all ports especially 80... I just want everyone can surf the net quickly without eatup my bandwith by downloading files..

thanks again..

Last edited by dadi; 06-04-2004 at 08:53 AM.
 
Old 06-04-2004, 09:20 AM   #7
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
sorry i cant help u more.

i just have an idea to do that.

go to http://www.szabilinux.hu/bandwidth/ and change the iptables commands like this:

$IPTABLES -t mangle -A FORWARD -s 192.168.0.128/29 -p tcp --dport "port_number" -j MARK --set-mark 3
$IPTABLES -t mangle -A FORWARD -s 192.168.0.6 -p tcp --dport "port_number" -j MARK --set-mark 3

# Download marking
$IPTABLES -t mangle -A POSTROUTING -s ! 192.168.0.0/24 -d 192.168.0.128/29 -p tcp --sport "port_number" -j MARK --set-mark 4
$IPTABLES -t mangle -A POSTROUTING -s ! 192.168.0.0/24 -d 192.168.0.6 -p tcp --sport "port_number" -j MARK --set-mark 4

lan: 192.168.0.0./24

change "port_number" to port u wanna limit, and try. i hope it will work

Last edited by maxut; 06-04-2004 at 09:22 AM.
 
Old 06-05-2004, 05:02 AM   #8
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Original Poster
Rep: Reputation: 0
well, I believe it will works for general limiting purpose.. unfortunately, as I told you that I wont be able to figure out what port number will be used.. everytime I open the link.. it use different port number.. (unless I'm lucky)

ok.. thanks for your help..

Last edited by dadi; 06-05-2004 at 05:06 AM.
 
Old 06-14-2004, 04:53 PM   #9
Cerbere
Member
 
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Check out Trickle. You can set it up to run as a daemon to control up/download rates for specific programs (ftp, sftp, ncftp, etc.)

Enjoy!
--- Cerbere
 
Old 06-19-2004, 10:16 AM   #10
dadi
LQ Newbie
 
Registered: Mar 2004
Posts: 10

Original Poster
Rep: Reputation: 0
oh thanks
hmm.. I just installed the trickle, but to be honest I don't understand how does it work

I'll keep trying to make it works anyway, thanks a lot

Last edited by dadi; 06-19-2004 at 10:36 AM.
 
  


Reply



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
"iptables tc" limiting bandwidth for specific port maxut Linux - Enterprise 1 12-16-2015 09:43 PM
Port Bandwith telemaco Linux - Networking 7 06-21-2005 07:41 PM
Rate limiting with Iptables on port 21 rino2003 Linux - Networking 1 12-26-2004 06:34 PM
Opinions on bandwith limiting Ringerx99 Linux - Networking 3 09-07-2003 12:03 PM
limiting upload on certain port keevitaja Linux - Networking 1 02-26-2003 02:50 PM

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

All times are GMT -5. The time now is 04:17 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
Open Source Consulting | Domain Registration