From: Xinwen - Fu <xinwenfu@cs.tamu.edu>
To: Rob Landley <landley@trommello.org>
Cc: linux-kernel@vger.kernel.org
Subject: SOCK_PACKET bypasses IPTABLES queue?
Date: Sun, 3 Feb 2002 18:33:41 -0600 (CST) [thread overview]
Message-ID: <Pine.SOL.4.10.10202031831480.25367-100000@dogbert> (raw)
In-Reply-To: <20020203221438.NAPP25931.femail13.sdc1.sfba.home.com@there>
Rob,
Another problem:
Will a packet from SOCK_PACKET socket bypass all the queues of
IPTABLES?
Thanks!
Xinwen Fu
On Sun, 3 Feb 2002, Rob Landley wrote:
> On Sunday 03 February 2002 01:45 pm, Xinwen - Fu wrote:
> > Hi, All,
> >
> > I want to know how a raw packet passes the chain of iptables.
> >
> > Here are the iptables chains
> >
> > --->PRE------>[ROUTE]--->FWD---------->POST------>
> > Conntrack | Filter ^ NAT (Src)
> > Mangle | | Conntrack
> > NAT (Dst) | [ROUTE]
> > (QDisc) v |
> > IN Filter OUT Conntrack
> >
> > | Conntrack ^ Mangle
> > |
> > | | NAT (Dst)
> >
> > v | Filter
> >
> >
> > So how a raw packet go through these chains?
>
>
> Well, from trial and error and a lot of documentation reading, I eventually
> worked out that a TCP/IP packet basically seems to do this:
>
> --->pre--->forward--->post--->
> | ^
> | |
> v |
> input->local ports->output
>
> I'd like to point out that the last arrow should point from "output" to
> "post", since kmail apparently is not using a fixed with font, and I can't
> figure out how to get it to do so. (I did figure out how to get it to use a
> korean, chinese, or cyrillic encoding, but not monospaced. Sigh...)
>
> So in prerouting, the packet is either forwarded on to the forwarding chain
> (if it's not for this box) or to the input chain (if it's for a daemon on
> this box). Forwarding never sees packets locally generated on this box, they
> go into the output chain and then get sent on to postrouting (which is where
> forwarding also feeds into).
>
> It took a little trial and error to work this out, by the way. It's entirely
> ossibly I'm wrong (since I don't think the above agrees with the
> documentation), but at the same time it works and survives specific behavior
> testing, so... :) The tables are fairly arbitrarily broken into "NAT" tables
> and non-NAT tables. Oh, and one of the chains (output, I think) exists in
> both nat and non-nat versions. To this day, I have no idea why...
>
> > Thanks!!
> >
> > Xinwen Fu
>
> If the above doesn't help, this might:
>
> http://netfilter.samba.org/unreliable-guides/
>
> Rob
>
next prev parent reply other threads:[~2002-02-04 0:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-03 18:45 raw socket packet and iptables Xinwen - Fu
2002-02-03 22:15 ` Rob Landley
2002-02-04 0:24 ` packet created by local raw socket Xinwen - Fu
2002-02-04 0:51 ` Rob Landley
2002-02-04 1:34 ` Andi Kleen
2002-02-04 0:33 ` Xinwen - Fu [this message]
2002-02-04 2:35 ` packet_socket = socket(PF_PACKET, int socket_type, int protocol); Xinwen - Fu
2002-02-04 3:29 ` Rob Landley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.SOL.4.10.10202031831480.25367-100000@dogbert \
--to=xinwenfu@cs.tamu.edu \
--cc=landley@trommello.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®