Helly guys ! :-) .
I need a (several?) advice(s) from you about my iptables setup. I'm pretty new to iptables, and this is the first time I configure a server with iptables ONLY as a firewall (we don't have money nor time to set a "true" firewall upfront).
I'd like to connect to my server via SSH from only specific.location.com.
Therefore, I set up the following rules in INPUT :
target in out source destination
ACCEPT lo any localhost anywhere
ACCEPT any any specific.location.com myserver.local tcp dpt:ssh
My default policies are :
INPUT DROP
FORWARD DROP
OUTPUT ACCEPT
With this first configuration, I was able to connect to my server, but unable to reach outside (like google.com), and the connection was very slow.
I understood that my firewall didn't have any rule including the state "ESTABLISHED" from a packet. Indeed, I guess my packets were able to get out, but weren't allowed to come back...
So I added this rule :
target in out source destination
ACCEPT any any anywhere anywhere state ESTABLISHED
Now all works like a charm, I can access outside from the server, the connection is very fast like before, and I can only access my server in SSH from specific.location.com !
My only question is that I need your advices, is that a clean configuration ? I don't find any example like this in internet, so I'm quite wondering...
Or did I just make a HUGE security fault ?!
Thanks for your help guys :-)