Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables blocks localhost even with accept
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
keschrich
n00b
n00b


Joined: 09 Apr 2002
Posts: 69
Location: Branford, CT

PostPosted: Sat Jan 18, 2003 2:25 am    Post subject: iptables blocks localhost even with accept Reply with quote

So long as iptables is running, I cannot connect to localhost from the computer, i.e. 'ping localhost' responds with:

Quote:
PING localhost (127.0.0.1): 56 octets data
sendto: Operation not permitted
ping: sent 64 octets to localhost, ret=-1


I know that it is an issue with iptables because once I stop the firewall everything runs fine..

Heres my rule set (its fairly simple as of yet):
Code:

-A INPUT -i lo -j ACCEPT
-A INPUT -i ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 8080 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i ppp0 -p tcp -m tcp --dport 554 -j ACCEPT
-A INPUT -i ppp0 -p udp -m udp --dport 6970:6999 -j ACCEPT
-A INPUT -i ppp0 -j DROP
-A POSTROUTING -o ppp0 -j MASQUERADE
-A POSTROUTING -o eth0 -j ACCEPT


As you can see I don't restrict any outbound traffic, so that shouldn't be an issue. At one point for testing reasons I put a LOG rule on the output chain '-A OUTPUT -o lo -j LOG' and I could see that packets were going through when I tried to ping, however when I put a similar rule on input '-I INPUT 1 -i lo -j LOG', I saw nothing at all.

If somebody could give a hand I would really appreciate it; this has become quite discouraging.
Back to top
View user's profile Send private message
Praxxus
Apprentice
Apprentice


Joined: 26 Nov 2002
Posts: 193
Location: Indiana, US

PostPosted: Sat Jan 18, 2003 2:49 am    Post subject: Reply with quote

You need the corresponding outbound rule for "lo."
Code:
-A OUTPUT -o lo -j ACCEPT


Please read up on IPTABLES firewalling and become familiar with the basics as soon as possible.
_________________
My glaucoma just got worse!
Back to top
View user's profile Send private message
keschrich
n00b
n00b


Joined: 09 Apr 2002
Posts: 69
Location: Branford, CT

PostPosted: Sat Jan 18, 2003 4:39 am    Post subject: Reply with quote

no, as i said i have not restricted outbound traffic, therefore everything is allowed to go out by default...plus id already tried that just in case to no avail
Back to top
View user's profile Send private message
Praxxus
Apprentice
Apprentice


Joined: 26 Nov 2002
Posts: 193
Location: Indiana, US

PostPosted: Sat Jan 18, 2003 5:21 am    Post subject: Reply with quote

Well, you had outbound rules for ppp0 and eth0, but didn't list one for lo. The one for lo should definitely be in there, usually the first outbound rule you have.

What are your default policies?
Is that your entire ruleset that you posted above?
_________________
My glaucoma just got worse!
Back to top
View user's profile Send private message
zleepy
n00b
n00b


Joined: 19 Dec 2002
Posts: 19
Location: /sweden/ludvika

PostPosted: Sat Jan 18, 2003 1:13 pm    Post subject: Reply with quote

Maybe some of the tutorials or how-to's here can be of help

http://www.netfilter.org/documentation/index.html#tutorials
Back to top
View user's profile Send private message
keschrich
n00b
n00b


Joined: 09 Apr 2002
Posts: 69
Location: Branford, CT

PostPosted: Sat Jan 18, 2003 2:29 pm    Post subject: Reply with quote

Quote:

Well, you had outbound rules for ppp0 and eth0, but didn't list one for lo. The one for lo should definitely be in there, usually the first outbound rule you have.


What are your default policies?
Is that your entire ruleset that you posted above?


excuse me, you were right...

all the rules I'd been adding trying to get this to work were going into the filter table, where there were no outgoing restrictions as i said. The postrouting rules were in the nat table, which is obvious if you look at the rules i had, but it totally slipped my mind. so all i needed was '-t nat -A POSTROUTING -o lo -j ACCEPT'.

that was my entire ruleset, the default being just a drop on the input chain of the filter table.
Back to top
View user's profile Send private message
Praxxus
Apprentice
Apprentice


Joined: 26 Nov 2002
Posts: 193
Location: Indiana, US

PostPosted: Mon Jan 20, 2003 6:33 am    Post subject: Reply with quote

So did that fix it?? :)
_________________
My glaucoma just got worse!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum