Skip to contentSkip to conversation

Band limit without squid

DISCUSSION Davi 4 participants 5 messages Mar 30, 2007 – Mar 31, 2007

lore
Share & tools
lore

Davi

author
#0 lore raw

Hi all!

I would like to reserve some band to some services. Like 30 Kb to HTTP, 60 Kb to POP/IMAP, 20 Kb to SMTP and FTP, i.e.

Can I do this using iptables + iproute or I must use Squid?

TIA

Signature · 21 lines
Davi Vidal
[email protected]
[email protected]
--

Agora com fortune:
"Microsoft Mandatory Survey (#9)

Customers who want to upgrade to Windows 98 Second Edition must now fill
out a Microsoft survey online before they can order the bugfix/upgrade.

Question 9: Which of the following do you prefer as a replacement for the
            current Microsoft slogan? 

A. "Over 20 Years of Innovation" 
B. "Wintel Inside" 
C. "Your Windows And Gates To The World"
D. "Because Anti-Trust Laws Are Obsolete" 
E. "One Microsoft Way. It's Much More Than An Address!" 
F. "This Motto Is Not Anti-Competitive. And Neither Is Microsoft." 
G. "Fighting the Department of Injustice Since Day One" "
#1 lore raw
Quoted 6 lines · Davi

Hi all!

I would like to reserve some band to some services. Like 30 Kb to HTTP, 60 Kb to POP/IMAP, 20 Kb to SMTP and FTP, i.e.

Can I do this using iptables + iproute or I must use Squid?

No to all three questions.

Jan

#2 lore raw
Quoted 9 lines · Jan Engelhardt
Quoted 6 lines · Davi

Hi all!

I would like to reserve some band to some services. Like 30 Kb to HTTP, 60 Kb to POP/IMAP, 20 Kb to SMTP and FTP, i.e.

Can I do this using iptables + iproute or I must use Squid?

No to all three questions.

... so you should take a look at doing some traffic shaping.

Point your browser to a search engine and type:

Linux traffic shaping

You'll get oodles of information.

Cheers,
--
pablo

author
#3 lore raw
In reply to Jan Engelhardt

Em Sexta 30 Março 2007 18:28, você escreveu:

Quoted 6 lines · Davi
Quoted 5 lines

Hi all!

I would like to reserve some band to some services. Like 30 Kb to HTTP, 60 Kb to POP/IMAP, 20 Kb to SMTP and FTP, i.e.

Quoted 6 lines
Quoted 1 line

Can I do this using iptables + iproute or I must use Squid?

No to all three questions.

Jan

Sorry... =P
Just one question: can I do this (band limit) without Squid?

Searching here, I found CBQ...
Anyone has used it?

TIA

Signature · 7 lines
Davi Vidal
[email protected]
[email protected]
--

Agora com fortune:
"This is a NO-FRILLS flight -- hold th' CANADIAN BACON!!"
#4 lore raw
Quoted 12 lines · Davi

Em Sexta 30 Março 2007 18:28, você escreveu:

Quoted 11 lines · Davi
Quoted 6 lines

Hi all!

I would like to reserve some band to some services. Like 30 Kb to HTTP, 60 Kb to POP/IMAP, 20 Kb to SMTP and FTP, i.e.

Can I do this using iptables + iproute or I must use Squid?

No to all three questions.

Quoted 8 lines
Quoted 1 line

Jan

Sorry... =P
Just one question: can I do this (band limit) without Squid?

Searching here, I found CBQ...
Anyone has used it?

More information about traffic shaping and the different classes (HTB, CBQ) here :

http://www.lartc.org/
http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm

Some useful examples :

http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm
http://lartc.org/wondershaper/

And with iptables you can use connmark target to mark your packets :
(working on it)

[...]

# Let's restore the mark, if there is one, otherwise redirect

# the packet to be matched
# A packet which has been marked is known to have the eighth bit set
iptables -t mangle -A traffic_shaping -m connmark --mark 0x80/0x80 \
	-j CONNMARK --restore-mark
iptables -t mangle -A traffic_shaping -m connmark --mark 0x80/0x80 \
	-j RETURN

# Set the right mark for traffic
# ------------------------------
# Set non-TCP packets to the highest priority since there is no handshake
# It means the client is not waiting for a reply to send you other data. This would result

# in the loss of theses data.
iptables -t mangle -A traffic_shaping -p !tcp \
		-j CONNMARK --set-mark 0x81
iptables -t mangle -A traffic_shaping -p ! tcp \
		-j RETURN

# Sort SSH connections

iptables -t mangle -A traffic_shaping -p tcp --sport 22 \
		-j CONNMARK --set-mark 0x82
iptables -t mangle -A traffic_shaping -p tcp --sport 22 \
		-j RETURN
iptables -t mangle -A traffic_shaping -p tcp --dport 22 \
		-j CONNMARK --set-mark 0x82

iptables -t mangle -A traffic_shaping -p tcp --dport 22 \
-j RETURN
[...]

Signature · 5 lines
Franck Joncourt
http://www.debian.org
http://smhteam.info/wiki/
GPG server : pgpkeys.mit.edu
Fingerprint : C10E D1D0 EF70 0A2A CACF 9A3C C490 534E 75C0 89FE