All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] I need some help with u32 filter
@ 2003-02-13 13:24 Remus
  2003-02-13 20:49 ` Stef Coene
  2003-02-14  8:24 ` Remus
  0 siblings, 2 replies; 3+ messages in thread
From: Remus @ 2003-02-13 13:24 UTC (permalink / raw)
  To: lartc

Hello,

This is my ADSL  connection :

ADSL 512k/256k
            |  eth0
--------------------
| Linux box aka fw | -
--------------------
            | eth1
the firewall has smtp and pop3 servers running (I have no spare PC for email
server, byt just for home use it is OK)

Could somebody check my script please, I'm bit  confused of ports 25 and 110
on eth0 and imq0.

tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1 htb default 10 r2q 100

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1 htb default 10 r2q 100

tc class add dev imq0 parent 1: classid 1:2 htb rate 500kbit burst 15k

tc class add dev imq0 parent 1:2 classid 1:10 htb rate 468kbit ceil 500Kbit
burst 30k prio 0
tc qdisc add dev imq0 parent 1:10 handle 10 sfq perturb 10

tc class add dev imq0 parent 1:2 classid 1:20 htb rate 32Kbit ceil 400Kbit
burst 15k prio 1
tc qdisc add dev imq0 parent 1:20 handle 20 sfq perturb 10

##############
tc filter add dev imq0 parent 1:0 protocol ip prio 100 u32 match ip sport 25
0xffff classid 1:20
Is it enough to have only sport 25 on download link or I need the dport as
well?
##############

tc class add dev eth0 parent 1: classid 1:2 htb rate 250kbit burst 15k

tc class add dev eth0 parent 1:2 classid 1:10 htb rate 218kbit ceil 250Kbit
burst 30k prio 0
tc qdisc add dev eth0 parent 1:10 handle 10 sfq perturb 10

tc class add dev eth0 parent 1:2 classid 1:20 htb rate 32Kbit ceil 250Kbit
burst 15k prio 1
tc qdisc add dev eth0 parent 1:20 handle 20 sfq perturb 10

##############
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport 25
0xffff classid 1:20
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport
110 0xffff classid 1:20
The same question on eth0 (upload link)
Is it enough to have only sport 25 and 110 on upload link or I need the
dport as well?
##############

Thank you very much in advance

Remus

_______________________________________________
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] I need some help with u32 filter
  2003-02-13 13:24 [LARTC] I need some help with u32 filter Remus
@ 2003-02-13 20:49 ` Stef Coene
  2003-02-14  8:24 ` Remus
  1 sibling, 0 replies; 3+ messages in thread
From: Stef Coene @ 2003-02-13 20:49 UTC (permalink / raw)
  To: lartc

On Thursday 13 February 2003 14:24, Remus wrote:
> Hello,
>
> This is my ADSL  connection :
>
> ADSL 512k/256k
>
>             |  eth0
>
> --------------------
>
> | Linux box aka fw | -
>
> --------------------
>
>             | eth1
>
> the firewall has smtp and pop3 servers running (I have no spare PC for
> email server, byt just for home use it is OK)
>
> Could somebody check my script please, I'm bit  confused of ports 25 and
> 110 on eth0 and imq0.
>
> tc qdisc del dev imq0 root
> tc qdisc add dev imq0 root handle 1 htb default 10 r2q 100
>
> tc qdisc del dev eth0 root
> tc qdisc add dev eth0 root handle 1 htb default 10 r2q 100
>
> tc class add dev imq0 parent 1: classid 1:2 htb rate 500kbit burst 15k
>
> tc class add dev imq0 parent 1:2 classid 1:10 htb rate 468kbit ceil 500Kbit
> burst 30k prio 0
> tc qdisc add dev imq0 parent 1:10 handle 10 sfq perturb 10
>
> tc class add dev imq0 parent 1:2 classid 1:20 htb rate 32Kbit ceil 400Kbit
> burst 15k prio 1
> tc qdisc add dev imq0 parent 1:20 handle 20 sfq perturb 10
>
> ##############
> tc filter add dev imq0 parent 1:0 protocol ip prio 100 u32 match ip sport
> 25 0xffff classid 1:20
> Is it enough to have only sport 25 on download link or I need the dport as
> well?
You never told us what's redirected to the imq device.  But I suppose it's 
incoming traffic from the internet.  If you want to match mail coming from 
the internet to your smtp server, you need dport 25.  All traffic is sended 
to your smtp and that's server is running on port 25.

> ##############
>
> tc class add dev eth0 parent 1: classid 1:2 htb rate 250kbit burst 15k
>
> tc class add dev eth0 parent 1:2 classid 1:10 htb rate 218kbit ceil 250Kbit
> burst 30k prio 0
> tc qdisc add dev eth0 parent 1:10 handle 10 sfq perturb 10
>
> tc class add dev eth0 parent 1:2 classid 1:20 htb rate 32Kbit ceil 250Kbit
> burst 15k prio 1
> tc qdisc add dev eth0 parent 1:20 handle 20 sfq perturb 10
>
> ##############
> tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport
> 25 0xffff classid 1:20
> tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport
> 110 0xffff classid 1:20
> The same question on eth0 (upload link)
> Is it enough to have only sport 25 and 110 on upload link or I need the
> dport as well?
You connect to port 25 and it's for traffic leaving the server, so you need 
sport 25.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net
_______________________________________________
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] I need some help with u32 filter
  2003-02-13 13:24 [LARTC] I need some help with u32 filter Remus
  2003-02-13 20:49 ` Stef Coene
@ 2003-02-14  8:24 ` Remus
  1 sibling, 0 replies; 3+ messages in thread
From: Remus @ 2003-02-14  8:24 UTC (permalink / raw)
  To: lartc

Thank very much Stef.
It works.

Best Regards

Remus

----- Original Message ----- 
From: "Stef Coene" <stef.coene@docum.org>
To: "Remus" <rmocius@auste.elnet.lt>; <lartc@mailman.ds9a.nl>
Sent: Thursday, February 13, 2003 8:49 PM
Subject: Re: [LARTC] I need some help with u32 filter


> > ##############
> > tc filter add dev imq0 parent 1:0 protocol ip prio 100 u32 match ip
sport
> > 25 0xffff classid 1:20
> > Is it enough to have only sport 25 on download link or I need the dport
as
> > well?
 You never told us what's redirected to the imq device.  But I suppose it's
 incoming traffic from the internet.  If you want to match mail coming from
 the internet to your smtp server, you need dport 25.  All traffic is sended
 to your smtp and that's server is running on port 25.
>
> > ##############
> > tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip
sport
> > 25 0xffff classid 1:20
> > tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip
sport
> > 110 0xffff classid 1:20
> > The same question on eth0 (upload link)
> > Is it enough to have only sport 25 and 110 on upload link or I need the
> > dport as well?
 You connect to port 25 and it's for traffic leaving the server, so you need
 sport 25.
>
> Stef

_______________________________________________
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:[~2003-02-14  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-13 13:24 [LARTC] I need some help with u32 filter Remus
2003-02-13 20:49 ` Stef Coene
2003-02-14  8:24 ` Remus

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.