On Tuesday 28 January 2003 13:46, Remco Post wrote:
> On Tue, 28 Jan 2003 15:21:03 +0200
>
> Andrei Syrovenko <[EMAIL PROTECTED]> wrote:
> > Monday, January 27, 2003, 9:30:04 PM, Guido van Rooij wrote:
> > > On Mon, Jan 27, 2003 at 10:46:58AM +0200, Andrei Syrovenko wrote:
> > >> Hello,
> > >>
> > >> 1. What I can see from your rules is you are trying to use policy
> > >> routing. Source routing is a different thing.
> > >>
> > >> 2. You can not mix policy routing (to <int>[:<ip>] clause) and keep
> > >> state technique in you rules, AFAIK.
> > >
> > > Why not? It should work..
> >
> > Because forwarding information from your rules is not stored in the
> > state table, so once the connection has been established and an entry
> > in the state table created, ipfilter won't route your packets anymore.
> >
> > Andrei.
>
> That would explain why one can't use 'flags S keep state' as one would
> do for a normal outgoing rule. I doesn't explain why you can't use keep
> state without any flags, so one every packet, mixed with policy routing.
>
> Remco
You can't use keep state without flags, coz it just floods the state table of
the firewall.
I can think of one way of doing it, it's nasty, but hey, and I'm not entirely
sure it'll work.
pass in from <ip> to <if>:<ip> flags S keep state head 101
# Match any packet which doesn't have the syn flag set, though
# We have to match the returned SYN-ACK packet.
pass in on any route-to <if> flags /S group 101
The idea being that the first packet with the S flag will match the first
rule, fail to match the second rule, and cause a state table entry, All
following packets will match the state table entry, then match the cheap-hack
routing statement.
Least that's the theory, not sure I got the syntax / flags correct, but it
should be doable.
It might be slightly more complicated, as return packets will match the keep
state rule, though they'll need routing to a different interface, but I'll
leave this as an excersize for the nutter^Wreader to add the appropriate
rules into the group to cope with this.
Why doesn't keep state remember routing ? Well, if you want it, you could
always write a patch, if not, you could consider not trying to use a firewall
package for routing. (I'm personally of the opinion that using firewall rules
to do routing is outside IPF's scope, however it's useful to have the ability
to do it).
I think a far better way to do it, would be to patch IPF to remember the
routing for keep state rules.
-Antony
*************************************************************************
This e-mail and any attachments may contain confidential or privileged
information. If you are not the intended recipient, please contact the
sender immediately and do not use, store or disclose their contents.
Any views expressed are those of the individual sender and not of Kinetic
Information System Services Limited unless otherwise stated.
www.kinetic.co.uk