* [LARTC] mixing u32 and fwmark
@ 2004-11-19 2:47 Kasp
2004-11-19 8:07 ` Catalin(ux aka Dino) BOIE
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kasp @ 2004-11-19 2:47 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1492 bytes --]
Hi!
There is one thing I can't do. In my country we have to pay for
"foreign" internet. Local internet is cheap and fast, but foreign is
slow and expensive. So I want do following:
mark every packet with iptables, where --set-mark 1 for foreign
internet, but --set-mark 2 for local internet
next when I got all traffic marking, I need to assign traffic to users
so I make classes, like:
tc qdisc add dev eth1 root handle 1: htb
tc class add dev eth1 parent 1: classid 1:1 htb rate 900kbps ceil 900kbps
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 30kbps ceil 500kbps
tc class add dev eth1 parent 1:10 classid 1:11 htb rate 10kbps ceil 10kbps
tc class add dev eth1 parent 1:10 classid 1:12 htb rate 30kbps ceil 50kbps
....
and now I have very big problem! How do I assign certain speed for
certain IP (and also looking is it local or foreign internet)
If I just set:
tc filter add dev eth1 parent 1: protocol ip prio 4 handle 0x1 fw classid 1:11
then it will affect all my users, but I need set this to each user
individually (each class) just to get sure, every user gets certain speed.
Actually it seems, I need to combine fwmark with u32 classifier or
something.
What do you sugest to do? I can't find a solution for my problem.
Advertisement:
Atrodiet savu celojumu seit!
http://travel.inbox.lv
[-- Attachment #2: Type: text/html, Size: 2256 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [LARTC] mixing u32 and fwmark
2004-11-19 2:47 [LARTC] mixing u32 and fwmark Kasp
@ 2004-11-19 8:07 ` Catalin(ux aka Dino) BOIE
2004-11-19 8:17 ` Eric Leblond
2004-11-19 16:55 ` George Alexandru Dragoi
2 siblings, 0 replies; 4+ messages in thread
From: Catalin(ux aka Dino) BOIE @ 2004-11-19 8:07 UTC (permalink / raw)
To: lartc
On Fri, 19 Nov 2004, Kasp wrote:
> Hi!
>
> There is one thing I can't do. In my country we have to pay for
> "foreign" internet. Local internet is cheap and fast, but foreign is
> slow and expensive. So I want do following:
>
> mark every packet with iptables, where --set-mark 1 for foreign
> internet, but --set-mark 2 for local internet
> next when I got all traffic marking, I need to assign traffic to users
> so I make classes, like:
>
> tc qdisc add dev eth1 root handle 1: htb
> tc class add dev eth1 parent 1: classid 1:1 htb rate 900kbps ceil 900kbps
>
> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 30kbps ceil 500kbps
>
> tc class add dev eth1 parent 1:10 classid 1:11 htb rate 10kbps ceil 10kbps
>
> tc class add dev eth1 parent 1:10 classid 1:12 htb rate 30kbps ceil 50kbps
> ....
>
> and now I have very big problem! How do I assign certain speed for
> certain IP (and also looking is it local or foreign internet)
>
> If I just set:
> tc filter add dev eth1 parent 1: protocol ip prio 4 handle 0x1 fw classid 1:11
>
> then it will affect all my users, but I need set this to each user
> individually (each class) just to get sure, every user gets certain speed.
>
> Actually it seems, I need to combine fwmark with u32 classifier or
> something.
> What do you sugest to do? I can't find a solution for my problem.
Please see http://kernel.umbrella.ro/
in "net" section you will find what you want.
---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LARTC] mixing u32 and fwmark
2004-11-19 2:47 [LARTC] mixing u32 and fwmark Kasp
2004-11-19 8:07 ` Catalin(ux aka Dino) BOIE
@ 2004-11-19 8:17 ` Eric Leblond
2004-11-19 16:55 ` George Alexandru Dragoi
2 siblings, 0 replies; 4+ messages in thread
From: Eric Leblond @ 2004-11-19 8:17 UTC (permalink / raw)
To: lartc
For local, foreign internet you can use :
http://www.cookinglinux.org/geoip/
BR,
On Fri, 2004-11-19 at 04:47 +0200, Kasp wrote:
> Hi!
>
> There is one thing I can't do. In my country we have to pay for
> "foreign" internet. Local internet is cheap and fast, but foreign is
> slow and expensive. So I want do following:
>
> mark every packet with iptables, where --set-mark 1 for foreign
> internet, but --set-mark 2 for local internet
> next when I got all traffic marking, I need to assign traffic to users
> so I make classes, like:
>
> tc qdisc add dev eth1 root handle 1: htb
> tc class add dev eth1 parent 1: classid 1:1 htb rate 900kbps ceil 900kbps
>
> tc class add dev eth1 parent 1:1 classid 1:10 htb rate 30kbps ceil 500kbps
>
> tc class add dev eth1 parent 1:10 classid 1:11 htb rate 10kbps ceil 10kbps
>
> tc class add dev eth1 parent 1:10 classid 1:12 htb rate 30kbps ceil 50kbps
> ....
>
> and now I have very big problem! How do I assign certain speed for
> certain IP (and also looking is it local or foreign internet)
>
> If I just set:
> tc filter add dev eth1 parent 1: protocol ip prio 4 handle 0x1 fw classid 1:11
>
> then it will affect all my users, but I need set this to each user
> individually (each class) just to get sure, every user gets certain speed.
>
> Actually it seems, I need to combine fwmark with u32 classifier or
> something.
> What do you sugest to do? I can't find a solution for my problem.
>
> __________
> Advertisement:
>
>
> Atrodiet savu celojumu seit!
--
Eric Leblond <eric@regit.org>
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LARTC] mixing u32 and fwmark
2004-11-19 2:47 [LARTC] mixing u32 and fwmark Kasp
2004-11-19 8:07 ` Catalin(ux aka Dino) BOIE
2004-11-19 8:17 ` Eric Leblond
@ 2004-11-19 16:55 ` George Alexandru Dragoi
2 siblings, 0 replies; 4+ messages in thread
From: George Alexandru Dragoi @ 2004-11-19 16:55 UTC (permalink / raw)
To: lartc
You can send the marked packets with 1 in a chain, and marked packets
with 2 in other chain, and then re-mark them based on
source/destination ips, and you will use only fw filters. What Cata
said looks damn intersting (I'll check that later). You may also sniff
the traffic with tcpdump and see if the tos value of internet is
different than the one from your country , so you can use only u32
filters. Another tool that might help you is mipclasses from
http://metropolitana.loginet.ro/
On Fri, 19 Nov 2004 04:47:36 +0200, Kasp <waters@inbox.lv> wrote:
> Hi!
There is one thing I can't do. In my country we have to pay
> for
"foreign" internet. Local internet is cheap and fast, but foreign
> is
slow and expensive. So I want do following:
mark every packet with
> iptables, where --set-mark 1 for foreign
internet, but --set-mark 2 for
> local internet
next when I got all traffic marking, I need to assign traffic
> to users
so I make classes, like:
tc qdisc add dev eth1 root handle 1:
> htb
tc class add dev eth1 parent 1: classid 1:1 htb rate 900kbps ceil
> 900kbps
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 30kbps
> ceil 500kbps
tc class add dev eth1 parent 1:10 classid 1:11 htb rate
> 10kbps ceil 10kbps
tc class add dev eth1 parent 1:10 classid 1:12 htb
> rate 30kbps ceil 50kbps
....
and now I have very big problem! How do I
> assign certain speed for
certain IP (and also looking is it local or foreign
> internet)
If I just set:
tc filter add dev eth1 parent 1: protocol ip prio
> 4 handle 0x1 fw classid 1:11
then it will affect all my users, but I need
> set this to each user
individually (each class) just to get sure, every user
> gets certain speed.
Actually it seems, I need to combine fwmark with u32
> classifier or
something.
What do you sugest to do? I can't find a solution
> for my problem.
> __________
> Advertisement:
>
>
>
> Atrodiet savu celojumu seit!
--
Bla bla
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-19 16:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19 2:47 [LARTC] mixing u32 and fwmark Kasp
2004-11-19 8:07 ` Catalin(ux aka Dino) BOIE
2004-11-19 8:17 ` Eric Leblond
2004-11-19 16:55 ` George Alexandru Dragoi
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.