I'm trying to block anything on my server except for some specific ip ranges. There should be neither access from web nor to ssh or anything else.
I searched already through different topics and found a solution which sounds fine:
iptables -P INPUT DROP
iptables -A INPUT -s IP/24 -j ACCEPT
Actually the drop works as it should, but as soon as I execute the command I'm disconnecting. I'm connected through an ssh client. I also tried to create a bash script. But after the dropping it drops me also and it seems that the script doesn't finish.
What can I do to achieve my goal?
iptables -A INPUT -s 10.10.0.0/24 -j ACCEPTso that10.10.0.0-10.10.255.255is allowed? If yes then I tried it already before and it dropped me as well. The IP is correct. – Michael Schneider Sep 02 '14 at 10:4610.10.0.0/24runs from10.10.0.0to10.10.0.255; you perhaps want10.10.0.0/16. – MadHatter Sep 02 '14 at 10:47