LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   iptables strange behaviour (Slackware64-14.0) (https://www.linuxquestions.org/questions/slackware-14/iptables-strange-behaviour-slackware64-14-0-a-4175466545/)

natharran 06-18-2013 06:05 PM

iptables strange behaviour (Slackware64-14.0)
 
Hi guys,

after reinstalling Slackware due to some partition changes, my iptables work really strange and I'm unable to determine why.

After install, all 3 chains have an ACCEPT policy. But when I change the INPUT to DROP via
Code:

iptables -P INPUT DROP
, not only all incoming traffic is being dropped, but outcoming as well. No outcoming traffic at all. I can't even ping my home router. But the OUTPUT chain still has an ACCEPT policy and there are no other rules (except for
Code:

iptables -A INPUT -i lo -j ACCEPT
, but it makes no difference whether it is or isn't there). When I change INPUT to ACCEPT, all is well again. But that's not the way it should be...

What troubles me most is that before reinstall, iptables were working correctly with these rules. They even work on my other computer with exactly the same rules.

I googled around but found nothing than iptables guides which basically tell me that all should be fine.

Help me please...:confused:

Ser Olmy 06-18-2013 06:38 PM

Unless you have a rule dealing with return traffic (state ESTABLISHED and possibly RELATED), the INPUT policy will block everything. You can actually ping your router, but you never get to see the reply packet.

Try this:
Code:

iptables -A INPUT -m state --state ESTALISHED,RELATED -j ACCEPT
I think you must have had a rule like that previously, or perhaps the INPUT policy was ACCEPT? Because the behaviour you describe is correct.

natharran 06-19-2013 05:24 AM

Quote:

Originally Posted by Ser Olmy (Post 4974476)
Code:

iptables -A INPUT -m state --state ESTALISHED,RELATED -j ACCEPT
I think you must have had a rule like that previously, or perhaps the INPUT policy was ACCEPT? Because the behaviour you describe is correct.

Thanks man, I don't know how I could forget I had this rule and also overlook it on my other computer. My brain, it seems, refuses to work late at nights :) . All's working now.

Thanks a lot.


All times are GMT -5. The time now is 07:54 AM.