Skip to contentSkip to conversation

Iptables problem

DISCUSSION Glenn Hancock 2 participants 2 messages Aug 13, 2003

lore
Share & tools
lore
#0 lore raw

I have the following setup in my /etc/sysconfig/iptables file. I start the iptables service and do a --list and see all my rules. I can attach to the computer from outside so I know that the incoming rules work, however, I can not perform any outgoing tasks. No pings, no ssh no nothing.

Can someone please explain why this is not working?

*filter
-A INPUT -p tcp --dport 110 --syn -j ACCEPT
-A INPUT -p tcp --dport 42 --syn -j ACCEPT
-A INPUT -p tcp --dport 7777 --syn -j ACCEPT
-A INPUT -p tcp --dport 7775 --syn -j ACCEPT
-A INPUT -p tcp --dport 22 --syn -j ACCEPT
-A INPUT -p tcp --dport 80 --syn -j ACCEPT
-A INPUT -p udp --dport 53 -j ACCEPT
-A INPUT -p udp --dport 42 -j ACCEPT
-A INPUT -p tcp --syn -j REJECT
-A INPUT -p udp -j REJECT
COMMIT

Thanks,

Signature · 15 lines
Glenn Hancock
SofTek Software International, Inc.
813 Pavilion Court
T: 678-583-5720
I: [email protected]
www.softeksoftware.com
www.Spambite.com
NOTE: My email address is currently protected by Spambite. If
you send me an email, you will be asked to validate your email
address on the Spambite network AND re-send you original email
to me. Or, you can pro-actively register your email address on
the Spambite network by visiting the website:
www.spambite.com
When visiting the website, please feel free to look around to
learn about this exciting new technology.
#1 lore raw
Quoted 17 lines

all my rules. I can attach to the computer from outside so I know that the incoming rules work, however, I can not perform any outgoing tasks. No pings, no ssh no nothing.

Can someone please explain why this is not working?

*filter

(quoted diff) +0 -10
-A INPUT -p tcp --dport 110 --syn -j ACCEPT
-A INPUT -p tcp --dport 42 --syn -j ACCEPT
-A INPUT -p tcp --dport 7777 --syn -j ACCEPT
-A INPUT -p tcp --dport 7775 --syn -j ACCEPT
-A INPUT -p tcp --dport 22 --syn -j ACCEPT
-A INPUT -p tcp --dport 80 --syn -j ACCEPT
-A INPUT -p udp --dport 53 -j ACCEPT
-A INPUT -p udp --dport 42 -j ACCEPT
-A INPUT -p tcp --syn -j REJECT
-A INPUT -p udp -j REJECT
Quoted 1 line

COMMIT

Is this rule-set complete ?

If it is, I see no rule like :

# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
Which might help to accept incoming packets that are a reply of an
outgoing packet.

If it isn't, it could be that you have set policy to DROP for the OUTPUT chain and have to ACCEPT rules for the OUTPUT chain : netfilter will not let any (locally generated) packets out.
To check : if you start the service, type :

# iptables -P OUTPUT ACCEPT
and then try to ping or something.

Gr,
Rob