Skip to contentSkip to conversation

extreme rDNS lag with iptables

DISCUSSION Ben 4 participants 4 messages Nov 4, 2003 – Nov 5, 2003

lore
Share & tools
lore

Ben

author
#0 lore raw

Hello,

I'm new to this list, so forgive me is I seem newbish :-)

The problem I am having that when I turn on iptables, I see rDNS lag to about 30 seconds. I see this happen with two programs I am using, proftpd and uwimap. Both work fine with flush tables, but when I run the following

IPTABLES="/sbin/iptables"

#Flush everything, start from scratch

$IPTABLES -F

#Set default policies to DROP

$IPTABLES -P INPUT DROP

$IPTABLES -P FORWARD DROP

#Set default OUTPUT policy to ACCEPT

$IPTABLES -P OUTPUT ACCEPT

# Open ports for server/services

$IPTABLES -A INPUT -p tcp --dport 20 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 25 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 37 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 43 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 53 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 53 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 110 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 113 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 143 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 443 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 465 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 465 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 873 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 873 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 993 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 995 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2082 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2083 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2086 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2087 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2089 -j ACCEPT

I see login request spike from almost instant to upwards of 30 seconds. This of course causes timeouts with most client software.

Has anyone run into this before? Does anyone know how I might go about fixing it?

#1 lore raw

I think you may need a FORWARD rule for DNS requests - INPUT and OUTPUT rules only affect locally generated traffic.

_____

From: [email protected] [mailto:[email protected]] On Behalf Of Ben
Sent: Tuesday, November 04, 2003 3:27 PM
To: [email protected]

Hello,

I'm new to this list, so forgive me is I seem newbish :-)

The problem I am having that when I turn on iptables, I see rDNS lag to about 30 seconds. I see this happen with two programs I am using, proftpd and uwimap. Both work fine with flush tables, but when I run the following

IPTABLES="/sbin/iptables"

#Flush everything, start from scratch

$IPTABLES -F

#Set default policies to DROP

$IPTABLES -P INPUT DROP

$IPTABLES -P FORWARD DROP

#Set default OUTPUT policy to ACCEPT

$IPTABLES -P OUTPUT ACCEPT

# Open ports for server/services

$IPTABLES -A INPUT -p tcp --dport 20 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 21 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 25 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 37 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 43 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 53 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 53 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 110 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 113 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 143 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 443 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 465 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 465 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 873 -j ACCEPT

$IPTABLES -A INPUT -p udp --dport 873 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 993 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 995 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2082 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2083 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2086 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2087 -j ACCEPT

$IPTABLES -A INPUT -p tcp --dport 2089 -j ACCEPT

I see login request spike from almost instant to upwards of 30 seconds. This of course causes timeouts with most client software.

Has anyone run into this before? Does anyone know how I might go about fixing it?

#2 lore raw
In reply to Ben

Hallo Ben,

Quoted 4 lines · On Tue, 4 Nov 2003 15:27:04 -0500 "Ben" <[email protected]> wrote:

Hello,

Quoted 8 lines

I'm new to this list, so forgive me is I seem newbish :-)

The problem I am having that when I turn on iptables, I see rDNS lag to about 30 seconds. I see this happen with two programs I am using, proftpd and uwimap. Both work fine with flush tables, but when I run the following

[...]

try to reject ident connections instead of dropping them () which is the default in your policy.

Jörg

Signature · 3 lines
Jörg Schütter           http://www.lug-untermain.de/
[email protected]     http://www.schuetter.org/joerg/
ICQ: 298982789          http://mypenguin.bei.t-online.de/
#3 lore raw
In reply to Ben
Quoted 3 lines · Ben

The problem I am having that when I turn on iptables, I see rDNS lag to about 30 seconds. I see this happen with two programs I am using, proftpd and uwimap. Both work fine with flush tables, but when I run the following

[rules removed]

Quoted 5 lines

I see login request spike from almost instant to upwards of 30 seconds. This of course causes timeouts with most client software.

Has anyone run into this before? Does anyone know how I might go about fixing it?

How about allowing answers for outgoing connections from your box back in? As your rules are now everything connecting FROM your box is dropped from your default policy.

Your box does at least outbound dns queries from a random source port, and most likely ident too (your ftp-daemon or more).

a simple

	iptables -A INPUT -m state --state ESTABLISHED,RELATED

should help a lot.

And adding a
iptables -A INPUT -j LOG
as the very last rule helps while debugging, this way you can see what your default policy drops.

c'ya
sven

Signature · 2 lines
The Internet treats censorship as a routing problem, and routes around it.
(John Gilmore on http://www.cygnus.com/~gnu/)