Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: miller69@gmx.net
To: lartc@vger.kernel.org
Subject: Re: [LARTC] QoS upstream and downstream...
Date: Fri, 15 Aug 2003 14:02:20 +0000	[thread overview]
Message-ID: <marc-lartc-106095624119525@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106095179515415@msgid-missing>

> Say I want to implement QoS for users like - 
> 512 kpbs downstream (incoming) and 128 kbps upstream (outgoing),
> 1 Mbps downstream (incoming) and 256 kbps upstream (outgoing), etc.
> Is it possible to implement the above QoS scheme using HTB,SFQ etc ?
> If yes how ? The network diagram is as given below.
Yes indeed! All you need is create the appropriate classes on the
network-interfaces. As I'm only using HTB and iptables I can give you just a HTB
example:

> eth1 : internal interface
> eth0/ppp0 : outgoing interface
Ok, let's say you create the following classes according to your
information:
eth1: 
-1:1 512kbps (user1)
-1:2 1Mbps (user2)

ppp0:
-2:1 128kbps (user1)
-2:2 256kbps (user2)       

user1's ip is 192.168.0.1
user2's ip is 192.168.0.2

The iptables rules would be:

#marking packets
iptables -t mangle -A FORWARD -s 192.168.0.1 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -d 192.168.0.1 -j MARK --set-mark 1
iptables -t mangle -A FORWARD -s 192.168.0.2 -j MARK --set-mark 2
iptables -t mangle -A FORWARD -d 192.168.0.2 -j MARK --set-mark 2

#putting packets in HTB classes
iptables -t mangle -A POSTROUTING -o eth1 -m mark --mark 1 -j CLASSIFY
--set-class 1:1

iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 1 -j CLASSIFY
--set-class 2:1

iptables -t mangle -A POSTROUTING -o eth1 -m mark --mark 1 -j CLASSIFY
--set-class 1:2

iptables -t mangle -A POSTROUTING -o eth0 -m mark --mark 1 -j CLASSIFY
--set-class 2:2

As I don't know your setup you can make sure that nothing goes wrong by
adding the incoming and outgoing interfaces at the marking part like this:
iptables -t mangle -A FORWARD -i eth1 -o ppp0 -s 192.168.0.1 -j MARK
--set-mark 1

For putting the packets into HTB classes you can also use tc filter if
you're not familar with CLASSIFY.

Hope that helps!
M.

-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  reply	other threads:[~2003-08-15 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-15 12:48 [LARTC] QoS upstream and downstream Rajesh
2003-08-15 14:02 ` miller69 [this message]
2003-08-19  9:20 ` miller69

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-106095624119525@msgid-missing \
    --to=miller69@gmx.net \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox