Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables newbie question

Reply
Thread Tools Display Modes

iptables newbie question

 
 
matthieu imbert
Guest
Posts: n/a

 
      04-15-2004, 09:10 PM
hi

two questions about iptables:

1/

i read the packet-filtering howto (http://netfilter.org/documentation/H...ing-HOWTO.html)
the first example uses the ip_conntrack module, which allows the state match rule, as in the following rules :

iptables -A block -m state --state NEW -j REJECT

on the other hand, my red hat 9 was automatically configured by lokkit with something that looks similar but without using ip_conntrack:

iptables -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --syn -j REJECT

what are the exact differences between these two ways of doing the same thing ?

2/

about fragments (see http://netfilter.org/documentation/H...g-HOWTO-7.html)

in the paragraph "specifying fragments", it says:
"If you are doing connection tracking or NAT, then all fragments will get merged back together before they reach the packet filtering code, so you need never worry about fragments."

but 5 lines below, it also says that we can only filter the first fragment, because further fragments don't have their tcp header.

so, are fragments merged or not ?

thanks in advance


 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a

 
      04-25-2004, 09:07 AM
matthieu imbert <(E-Mail Removed)> said:
>i read the packet-filtering howto
>(http://netfilter.org/documentation/H...ing-HOWTO.html)
>the first example uses the ip_conntrack module, which allows the state
>match rule, as in the following rules :
>
>iptables -A block -m state --state NEW -j REJECT
>
>on the other hand, my red hat 9 was automatically configured by lokkit
>with something that looks similar but without using ip_conntrack:
>
>iptables -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --syn -j REJECT
>
>what are the exact differences between these two ways of doing the same
>thing ?


The RedHat lokkit way is archaic; it dates back to "ipchains", which was
a stateless filter -- you only could filter by the packet contents.

The stateful filtering allows for more fine-grained filtering. Consider,
for example, that you wish to allow outbound HTTP sessions. Without
connection tracking, you need to allow all incoming packets from port 80.
Also, you would need to rather indiscriminately allow incoming ICMP
traffic. With connection tracking, you state that you wish to allow
outbound connection requests to port 80, and inbound packets that are
related to or belong to established connections.

The difference is even greater with UDP protocol, which, being a stateless
protocol, doesn't contain session state in the packet header.

>about fragments (see
>http://netfilter.org/documentation/H...g-HOWTO-7.html)
>
>in the paragraph "specifying fragments", it says:
>"If you are doing connection tracking or NAT, then all fragments will
>get merged back together before they reach the packet filtering code, so
>you need never worry about fragments."
>
>but 5 lines below, it also says that we can only filter the first
>fragment, because further fragments don't have their tcp header.
>
>so, are fragments merged or not ?


In the first paragraph, note the words "If you are doing connection
tracking or NAT". So, for firewall set-ups where you don't have either
of these two features in use (like RH lokkit), the fragments are not
merged. Or at least this is how I read that documentation.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables - newbie explodingGo4@gmail.com Linux Networking 5 01-11-2006 03:32 AM
iptables and logging [newbie] Madhur Ahuja Linux Networking 3 10-11-2004 05:08 PM
Newbie on iptables; want to deny access to 192.168.0.5 =?ISO-8859-1?Q?Ga=E9tan_Martineau?= Linux Networking 1 08-28-2004 07:42 PM
Newbie Question -- iptables flow of control Bob Simon Linux Networking 1 01-28-2004 05:30 PM
iptables question.... sam Linux Networking 0 09-22-2003 03:27 PM



1 2 3 4 5 6 7 8 9 10 11