I am in the process of setting up my firewall using iptables. This is the first time I have ever attempted something like this.
So far I have the following rules:
# Clear any previous entries
--flush
--delete-chain
# Set the default policies for all three default chains
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT ACCEPT
# Enable use of the loopback interface
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
# Accept inbound TCP packets
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
# Accept inbound UDP packets
-A INPUT -p udp --dport 123 -j ACCEPT
# Accept inbound ICMP messages
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
The ports I have open are 80 (http), 443 (https), 22 (ssh), 123 (ntp).
Any suggestions or improvements would be greatly appreciated.