Linux Netfilter discussions
 help / color / mirror / Atom feed
From: mouss <mouss@netoyen.net>
Cc: netfilter@vger.kernel.org
Subject: Re: iptables block samba or not?
Date: Thu, 24 Jan 2008 21:16:26 +0100	[thread overview]
Message-ID: <4798F21A.8070107@netoyen.net> (raw)
In-Reply-To: <4797B8FC.8080308@bspu.unibel.by>

Dzianis Kahanovich wrote:
> Eial Czerwacki wrote:
>
>> -A INPUT -p tcp -m state --state NEW --dport 135 -s 132.72.144.0/20 
>> -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 139 -s 132.72.144.0/20 
>> -j ACCEPT
>> -A INPUT -p udp -m state --state NEW --dport 137:138 -s 
>> 132.72.144.0/20 -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 426 -s 132.72.144.0/20 
>> -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 445 -s 132.72.144.0/20 
>> -j ACCEPT
>>
>> -A INPUT -p tcp -m state --state NEW --dport 135 -s 192.168.114.0/24 
>> -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 139 -s 192.168.114.0/24 
>> -j ACCEPT
>> -A INPUT -p udp -m state --state NEW --dport 137:138 -s 
>> 192.168.114.0/24 -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 426 -s 192.168.114.0/24 
>> -j ACCEPT
>> -A INPUT -p tcp -m state --state NEW --dport 445 -s 192.168.114.0/24 
>> -j ACCEPT
>>
>> # up to 5 Bit-torrent connections
>> -A INPUT -p tcp -m state --state NEW --dport 6881:6886 -j ACCEPT
>>
>> #else
>> -A INPUT -j REJECT --reject-with icmp-port-unreachable
>
> You ACCEPTing only NEW connection state - initial packets for every 
> session.
> Remove "-m state -- state NEW".
>
>

or at least add stateful rules for output. but it is true that managing 
state in this case is cumbersome at best.

Another thing is that he is no allowing ICMP. It may be just me, but I 
tend to consider a machine as disconnected if it does not respond to 
ping... and while it be argued that this is helpful to protect winboxes, 
I would be frightened if this argument applied to a (not too old) linux 
or bsd ;-p

Finally, adding a rule to log rejected packets would help debugging 
whatever issues happen.



  reply	other threads:[~2008-01-24 20:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-21 22:33 iptables block samba or not? Eial Czerwacki
2008-01-22  1:52 ` Leonardo Rodrigues Magalhães
2008-01-23 22:00 ` Dzianis Kahanovich
2008-01-24 20:16   ` mouss [this message]
2008-01-24 20:17   ` Eial Czerwacki
2008-01-24 21:13     ` mouss
2008-01-24 21:37       ` Martijn Lievaart
2008-01-25 10:40       ` Eial Czerwacki
2008-01-25 11:49         ` mouss
2008-01-25 13:35           ` Eial Czerwacki
2008-01-25 13:42             ` mouss
2008-01-25 14:27               ` Eial Czerwacki
2008-01-25 15:15                 ` mouss
2008-01-25 16:02                   ` Eial Czerwacki
2008-01-25 16:13                     ` mouss
2008-01-25 16:53                       ` Eial Czerwacki
2008-01-25 19:02                         ` Martijn Lievaart
2008-01-25 16:04                   ` Steven Ayre

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=4798F21A.8070107@netoyen.net \
    --to=mouss@netoyen.net \
    --cc=netfilter@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