I want to block all IPs except for my own home IP from doing anything on my server.How can I do this with iptables? For the example lets say my home IP is 1.2.3.4My server still needs to be able to connect to various IPs. Also by doing this will this cause any general problems?Something like this? (doesn't work)/sbin/iptables -A INPUT -s 1.2.3.4 -j ACCEPTiptables -A INPUT -s 0.0.0.0/0 -j DROPiptables -A OUTPUT -d 0.0.0.0/0 -j DROP
Block all IPs from accessing anything on the server
iptables
Leave the OUTPUT chain untouched. Put these in your INPUT chainiptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPTiptables -A INPUT -s 1.2.3.4 -j ACCEPTiptables -A INPUT -j DROP    # or REJECTThe first rule allows your iptables configuration to accept traffic for established connections (i.e. those initiated by your own server to other destinations).