Can't get iptables firewall working correctly

Posted by Jay on Server Fault See other posts from Server Fault or by Jay
Published on 2012-11-03T19:49:15Z Indexed on 2012/11/04 11:05 UTC
Read the original article Hit count: 194

Filed under:
|

I'm setting up a new Centos 5.6 system and can't get my iptables firewall to work correctly. it won't let me use SSH through it. I'm new to Centos but not to Linux or iptables.

I've been removing things until I have isolated the problem. I set up the firewall with a default ACCEPT rule for the INPUT chain. I can connect through to the server fine. If I change the command to only allow traffic from the interface connecting to my trusted network it stops working.

Working:

iptables -A INPUT -s 0/0 -d 0/0 -j ACCEPT

Failing:

iptables -A INPUT -i eth0 -s 0/0 -d 0/0 -j ACCEPT

I've double checked the ip address I'm using corresponds to eth0 using ifconfig.

Any ideas where I went wrong?

© Server Fault or respective owner

Related posts about centos

Related posts about iptables