* [LARTC] Simple case here!
@ 2004-12-28 14:52 Amit Vyas
2004-12-29 11:41 ` Amit Vyas
2005-01-02 0:34 ` Andy Furniss
0 siblings, 2 replies; 3+ messages in thread
From: Amit Vyas @ 2004-12-28 14:52 UTC (permalink / raw)
To: lartc
Hi All,
I want to setup a machine to connect to internet at a limited rate of 64
kbps.
That machine is connected to a switch. so my LAN and Internet both comes
from the same eth0.
How can I limit only the internet access from this machine to 64kbps and
still using 100mbps for LAN
I am trying to implement this Please guide me If i am wrong.
I mark all the packets going out to LAN.
Then I can setup a root qdisc to classify packets based on that mark. If
match then I can setup a class to accept those setup a fifo for those
packets. but if the packets are not for the LAN then i can pass them to
other class which is tbf shaping at rate 64kbps.
Am i right on these lines.
This is the setup
+------------+ eth0 +-----------+ internet
| machine |---------------| Switch |-------------
+------------+ +-----------+
trying to get some thing like this
root qdisc (CBQ or something)
/ \
/ \
/ \
/ \
class class
Internal LAN Pcakets Any other unclassified Packets
| |
| |
FIFO TBF (rate 64kbps)
Please Help me out with marking the packets and to classify them.
Just started off with Traffic Shaping. gigles...... : )
It is alos possible to alternatively to mark internet traffic as it
would be less in comparison to LAN and thus processor friendly.
Amit Vyas
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [LARTC] Simple case here!
2004-12-28 14:52 [LARTC] Simple case here! Amit Vyas
@ 2004-12-29 11:41 ` Amit Vyas
2005-01-02 0:34 ` Andy Furniss
1 sibling, 0 replies; 3+ messages in thread
From: Amit Vyas @ 2004-12-29 11:41 UTC (permalink / raw)
To: lartc
I tried This for the following setup but it doesn't seems to be working
Please suggest.
//making a root cbq
tc qdisc add dev eth0 root handle 1:0 cbq bandwidth 100Mbit allot 1514
cell 8 avpkt 1000 mpu 64
//making one class under root with limiting 64kbps
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 1Mbit rate
64Kbit allot 1514 cell 8 avpkt 1000 mpu 64 isolated
//Making other class which can take all the packets for the LAN and
procced with them at spped available.
tc class add dev eth0 parent 1:0 classid 1:2 cbq bandwidth 99Mbit rate
100kbit weight 9kbit allot 1514 cell 8
//filtering the packets so that they can be classified for class 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst
192.168.3.0/32 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip u32 match ip dst
192.168.2.0/32 classid 1:2
Amit Vyas wrote:
>
> Hi All,
>
> I want to setup a machine to connect to internet at a limited rate of
> 64 kbps.
> That machine is connected to a switch. so my LAN and Internet both
> comes from the same eth0.
> How can I limit only the internet access from this machine to 64kbps
> and still using 100mbps for LAN
>
> I am trying to implement this Please guide me If i am wrong.
> I mark all the packets going out to LAN.
> Then I can setup a root qdisc to classify packets based on that mark.
> If match then I can setup a class to accept those setup a fifo for
> those packets. but if the packets are not for the LAN then i can pass
> them to other class which is tbf shaping at rate 64kbps.
>
> Am i right on these lines.
> This is the setup
>
> +------------+ eth0 +-----------+ internet
> | machine |---------------| Switch |-------------
> +------------+ +-----------+
>
> trying to get some thing like this
>
> root qdisc (CBQ or something)
> / \
> / \
> / \
> / \
> class class
> Internal LAN Pcakets Any other unclassified Packets
> | |
> | |
> FIFO TBF (rate 64kbps)
>
> Please Help me out with marking the packets and to classify them.
> Just started off with Traffic Shaping. gigles...... : )
>
> It is alos possible to alternatively to mark internet traffic as it
> would be less in comparison to LAN and thus processor friendly.
>
> Amit Vyas
>
>
>
>
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LARTC] Simple case here!
2004-12-28 14:52 [LARTC] Simple case here! Amit Vyas
2004-12-29 11:41 ` Amit Vyas
@ 2005-01-02 0:34 ` Andy Furniss
1 sibling, 0 replies; 3+ messages in thread
From: Andy Furniss @ 2005-01-02 0:34 UTC (permalink / raw)
To: lartc
Amit Vyas wrote:
>
> Hi All,
>
> I want to setup a machine to connect to internet at a limited rate of 64
> kbps.
> That machine is connected to a switch. so my LAN and Internet both comes
> from the same eth0.
> How can I limit only the internet access from this machine to 64kbps and
> still using 100mbps for LAN
>
> I am trying to implement this Please guide me If i am wrong.
> I mark all the packets going out to LAN.
> Then I can setup a root qdisc to classify packets based on that mark. If
> match then I can setup a class to accept those setup a fifo for those
> packets. but if the packets are not for the LAN then i can pass them to
> other class which is tbf shaping at rate 64kbps.
>
> Am i right on these lines.
> This is the setup
>
> +------------+ eth0 +-----------+ internet
> | machine |---------------| Switch |-------------
> +------------+ +-----------+
>
> trying to get some thing like this
>
> root qdisc (CBQ or something)
> / \
> / \
> / \
> / \
> class class
> Internal LAN Pcakets Any other unclassified Packets
> | |
> | |
> FIFO TBF (rate 64kbps)
>
> Please Help me out with marking the packets and to classify them.
> Just started off with Traffic Shaping. gigles...... : )
>
> It is alos possible to alternatively to mark internet traffic as it
> would be less in comparison to LAN and thus processor friendly.
>
> Amit Vyas
I would use netfilter + HTB something like -
$TC qdisc add dev eth0 root handle 1:0 htb default 0
$TC class add dev eth0 parent 1:0 classid 1:1 htb rate 64kbit
$TC filter add dev eth0 parent 1:0 protocol ip handle 1 fw flowid 1:1
$IPTABLES -t mangle -A POSTROUTING -o eth0 --dst ! 192.168.0.0/24 -j
MARK --set-mark 1
Depending on what the PC does it may be nicer to priorotise empty acks /
udp headed for the internet over bulk traffic.
Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-01-02 0:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-28 14:52 [LARTC] Simple case here! Amit Vyas
2004-12-29 11:41 ` Amit Vyas
2005-01-02 0:34 ` Andy Furniss
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.