All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graste <graste@gmx.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] incoming traffic??
Date: Sun, 11 May 2003 12:37:19 +0000	[thread overview]
Message-ID: <marc-lartc-105265661103635@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105258341931128@msgid-missing>

On Sun, 11 May 2003 10:13:08 +0000, sun reflex4 <sunreflex4@hotmail.com> 
wrote:

> well, I have 2 interfaces, but I didn't get what you mean. You say I use 
> one for incoming and one for outgoing? can this then be achieved only 
> with iptables and tc?
>
> Best greetings
>

Yes it can. Outgoing traffic can be shaped on your outgoing interface on 
your gateway. Incoming traffic is a little bit trickier - but if you have 
two interfaces you can use the interface that connects to your lan. Check 
http://www.docum.org/stef.coene/qos/kptd/ and you get a clue where to mark 
packets with iptables and then use tc and tc filter to do your shaping.

e.g. for download/incoming traffic:

#delete qdisc on dev
tc qdisc del dev $INTIF root 2>/dev/null
#new root qdisc
tc qdisc add dev $INTIF root handle 2:0 htb default 20
#some classes
tc class add dev $INTIF parent 2:0 classid 2:2 htb rate 10mbps ceil 101mbps
tc class add dev $INTIF parent 2:2 classid 2:20 htb rate 2000kbps ceil 
101mbps prio 2 ...

or whatever qdiscs and classes and then:

#create a class for a single user for example
tc class add dev $INTIF parent 2:20 classid 2:2001 htb rate 1kbps ceil 
200kbps
#mark his incoming traffic
/sbin/iptables -A POSTROUTING -t mangle -o $INTIF -p tcp --destination 
192.168.1.1 -j MARK --set-mark 2001
#send all his incoming traffic to his class
tc filter add dev $INTIF parent 2:0 protocol ip handle 2001 fw flowid 
2:2001

$INTIF is the interface, that connects to your lan. Dunno if it is all 
right what I wrote here fast. So you have to recheck before use. Hope it 
helps anyway.


Regards,

Graste

-- 
Using M2, Opera's new e-mail client.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2003-05-11 12:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-10 16:15 [LARTC] incoming traffic?? sun reflex4
2003-05-10 18:05 ` Jose Luis Domingo Lopez
2003-05-11  4:49 ` hare ram
2003-05-11 10:13 ` sun reflex4
2003-05-11 12:37 ` Graste [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-10-04  9:33 [LARTC] Incoming traffic? Dominik Werder
2005-10-04 10:00 ` Andreas Klauer
2005-10-04 13:08 ` Edward Smith
2005-10-04 17:53 ` Carl-Daniel Hailfinger

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-105265661103635@msgid-missing \
    --to=graste@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.