Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables and --dport 53

Reply
Thread Tools Display Modes

iptables and --dport 53

 
 
Richard
Guest
Posts: n/a

 
      09-24-2003, 07:51 AM
hii
when I insert --dport 53 accept rule in output chanin my server is very
slowing
my iptables-save output is ;
-A INPUT -i eth0 -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -o eth0 -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
When I remove this rule server is back normal


 
Reply With Quote
 
 
 
 
Horst Knobloch
Guest
Posts: n/a

 
      09-24-2003, 11:06 AM
Richard <(E-Mail Removed)> wrote:

> when I insert --dport 53 accept rule in output chanin my server is very
> slowing


Could you explain a little bit more what you mean with "slow"?


> my iptables-save output is ;
> -A INPUT -i eth0 -p tcp -m tcp --dport 110 -j ACCEPT
> -A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
> -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
> -A INPUT -i lo -j ACCEPT
> -A OUTPUT -o lo -j ACCEPT
> -A OUTPUT -o eth0 -p udp -m udp --dport 53 -j ACCEPT
> -A OUTPUT -o eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
> When I remove this rule server is back normal


This isn't the entire output from iptables-save (at least
the Default Policy of INPUT and OUTPUT is missing).
If I assume the policy is DROP, then you can't resolve names,
regardless whether you have the rule or not. Since you only
allow outgoing DNS queries but not the related incoming
response back. So you need to add at least the following:

-A INPUT -i eth0 -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT


HTH

Ciao, Horst
--
»When pings go wrong (It hurts me too)« E.Clapton/E.James/P.Tscharn
 
Reply With Quote
 
Juha Laiho
Guest
Posts: n/a

 
      09-24-2003, 07:27 PM
Horst Knobloch <(E-Mail Removed)> said:
>Richard <(E-Mail Removed)> wrote:
>
>> when I insert --dport 53 accept rule in output chanin my server is very
>> slowing
>> my iptables-save output is ;
>> -A INPUT -i eth0 -p tcp -m tcp --dport 110 -j ACCEPT
>> -A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
>> -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT

....
>If I assume the policy is DROP, then you can't resolve names,
>regardless whether you have the rule or not. Since you only
>allow outgoing DNS queries but not the related incoming
>response back. So you need to add at least the following:
>
>-A INPUT -i eth0 -p udp -m state --state RELATED,ESTABLISHED -j ACCEPT


Or rather, replace the original
-A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
with
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT

.... so, lose the protocol check completely. The above already will drop
packets that are not somehow related to already established connections.
Limiting protocols in this is just a way of breaking ones own networking
functionality (as some information related to error conditions of TCP
and UDP traffic is passed by various ICMP subtypes).
--
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
 
Horst Knobloch
Guest
Posts: n/a

 
      09-24-2003, 08:24 PM
Juha Laiho <(E-Mail Removed)> wrote:

> Horst Knobloch <(E-Mail Removed)> said:
>>Richard <(E-Mail Removed)> wrote:
>>

[...]
> Or rather, replace the original
> -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j ACCEPT
> with
> -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
>
> ... so, lose the protocol check completely.


Yes, that's better of course.

Ciao, Horst
--
»When pings go wrong (It hurts me too)« E.Clapton/E.James/P.Tscharn
 
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 v1.3.4: "--dport unknown argument" Dimitry Linux Networking 2 01-23-2007 07:50 PM
iptables: 127.0.0.1 != lo Timo Nentwig Linux Networking 6 05-10-2005 06:50 PM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
Routing based on dport bill davidsen Linux Networking 0 10-17-2003 06:23 PM
iptables "can't initialize iptables table `filter'" pete Linux Networking 1 10-10-2003 03:44 AM



1 2 3 4 5 6 7 8 9 10 11