NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: family inet and parameter stateful | npf.conf




Darrel <levitch%iglou.com@localhost> wrote:
If the problem still occurs, then can you describe the connection i.e.
what/where exactly is your source and destination?

Just to be sure -- when using "stateful", one should be aware that for
TCP connections the rule should apply for the initiating (SYN) packet.
If, for example, direction is confused and the rule is applied for the
reply (SYN-ACK) packet - connection tracking engine will not try to fix
it up and will eventually time out the state.


The particular server that I had login problems with is okay now, rather
I have been logged into it for a couple of days.  Perhaps I had an extra
line in my npf.conf that was causing my problem, but am not certain.
Having just begun to use NPF, I made lots of rapid changes and was losing
sleep.

So to hopefully further clarify "stateful".  What I am using now:

         pass stateful out final family inet from $if_ext apply "rid"
         pass stateful in family inet to $if_ext

should be changed to:

         pass stateful out final family inet from $if_ext apply "rid"
         pass in family inet to $if_ext

No, it would be the case I described.  The second rule passes incoming
traffic without state creation and the outgoing reply packet (SYN-ACK)
from your machine would match the first rule, which would create the
state on a wrong direction.  So your first case is correct.  You can
also limit the first rule to TCP and SYN, e.g.:

pass stateful out final family inet proto tcp flags S/SA from $if_ext

or am I still missing something?  I am particularly wondering about
logging- is this set up by the user or perhaps have some defaults that
might not need much tweaking?

npflog is just a virtual interface for BPF tap.  You can tcpdump it.


Hey, Mindaugas.

The  rdesktop application or msft seems to be a unique case.

This is what I am using and works for now:

procedure "rid" {
        normalise:  "random-id"
}

procedure "nf" {
        normalise:  "random-id"
        normalise:  "no-df"
}

table <6> which is the address space mask of msft2008r2

        pass out final family inet from $if_ext to <6>
        pass stateful out family inet proto icmp from $if_ext apply \
                "rid"
        pass stateful out family inet proto udp from $if_ext apply "rid"
        pass stateful out family inet proto tcp flags S/SA from $if_ext\
                apply "nf"

        !-- th will be refined:
        pass stateful in family inet proto icmp to $if_ext apply "log"
        pass in family inet from <6> to $if_ext

If I remove 'pass in family inet from <6> to $if_ext' or
*put stateful* on 'pass out final family inet from $if_ext to <6>'
then I can not login through rdesktop

I have a small collection of tcpdumps, but if you are interested in
anything specific then please let me know.

If it important for us to know at this point about the 'tcp cases'?

Invalid packet state cases:
        2665 cases in total
        2620 TCP case I
        44 TCP case II
        1 TCP case III

Peace,
Darrel

and what i meant about refining my icmp statement would be to only include echorequest of traceroute -I cases.

Home | Main Index | Thread Index | Old Index