All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] IMQ and fwmark
@ 2003-07-29  8:55 Daniel Brahneborg
  2003-07-29  9:19 ` Andrew Hall
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Brahneborg @ 2003-07-29  8:55 UTC (permalink / raw)
  To: lartc

Hi all,

I want to divide the incoming traffic between what should go to
the firewall and what should be forwarded to the local network
behind it.  I started with the IMQ example config, but added an
extra htb class right below "10:1" to get the two sfq's to borrow
each other's bandwidth.

However, I can't figure out how to set the two marks.  According to
this picture, taken from http://lartc.org/lartc.html, I thought I could
set the marks in FORWARD and INPUT, but that didn't work at all.  The
traffic ends up in imq0 as it should, but only goes to the default
class.  Moving the '-j IMQ' to the INPUT and FORWARD tables didn't
work either.  What have I done wrong?

        +------------+                +---------+               +-------------+
Packet -| PREROUTING |--- routing-----| FORWARD |-------+-------| POSTROUTING |- Packets
input   +------------+    decision    +---------+       |       +-------------+    out
                             |                          |
                       +-------+                    +--------+   
                       | INPUT |---- Local process -| OUTPUT |
                       +-------+                    +--------+

iptables -t mangle -A INPUT   -i $EXTERNAL_INTERFACE -p tcp -j MARK --set-mark 0x1
iptables -t mangle -A FORWARD -i $EXTERNAL_INTERFACE -p tcp -j MARK --set-mark 0x2
iptables -t mangle -A PREROUTING -i $EXTERNAL_INTERFACE -j IMQ

/Basic

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] IMQ and fwmark
  2003-07-29  8:55 [LARTC] IMQ and fwmark Daniel Brahneborg
@ 2003-07-29  9:19 ` Andrew Hall
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Hall @ 2003-07-29  9:19 UTC (permalink / raw)
  To: lartc

Access to the IMQ interface sits between the mangle and DNAT tables in the
PREROUTING chain and after the connection tracking table in the POSTROUTING
chain. There isn't much point in setting marks for the IMQ from the INPUT
and FORWARD chains as these are traversed AFTER the IMQ interface
(PREROUTE). To correctly set the marks then you would need to set them in
the mangle table of the PREROUTE chain and do it based on address. Hope this
helps.

Andrew.
----- Original Message -----
From: "Daniel Brahneborg" <basic@chello.se>
To: "Linux Advanced Router & Traffic Control" <lartc@mailman.ds9a.nl>
Sent: Tuesday, July 29, 2003 6:55 PM
Subject: [LARTC] IMQ and fwmark


> Hi all,
>
> I want to divide the incoming traffic between what should go to
> the firewall and what should be forwarded to the local network
> behind it.  I started with the IMQ example config, but added an
> extra htb class right below "10:1" to get the two sfq's to borrow
> each other's bandwidth.
>
> However, I can't figure out how to set the two marks.  According to
> this picture, taken from http://lartc.org/lartc.html, I thought I could
> set the marks in FORWARD and INPUT, but that didn't work at all.  The
> traffic ends up in imq0 as it should, but only goes to the default
> class.  Moving the '-j IMQ' to the INPUT and FORWARD tables didn't
> work either.  What have I done wrong?
>
>         +------------+                +---------+
+-------------+
> Packet -| PREROUTING |--- routing-----| FORWARD |-------+-------|
POSTROUTING |- Packets
> input   +------------+    decision    +---------+       |
+-------------+    out
>                              |                          |
>                        +-------+                    +--------+
>                        | INPUT |---- Local process -| OUTPUT |
>                        +-------+                    +--------+
>
> iptables -t mangle -A INPUT   -i $EXTERNAL_INTERFACE -p tcp -j
MARK --set-mark 0x1
> iptables -t mangle -A FORWARD -i $EXTERNAL_INTERFACE -p tcp -j
MARK --set-mark 0x2
> iptables -t mangle -A PREROUTING -i $EXTERNAL_INTERFACE -j IMQ
>
> /Basic
>
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2003-07-29  9:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-29  8:55 [LARTC] IMQ and fwmark Daniel Brahneborg
2003-07-29  9:19 ` Andrew Hall

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.