iptables -Lin the command line. Next enter
iptables -P INPUT ACCEPTthis will allow iptables to accept all rules.
Now that iptables has been wiped and flushed, we will begin setting up our new rules
man iptablesinto the command line, this will give you some insight into some of the options inside IP Tables.
sudo iptables -A INPUT -i lo -j Accept. This command will allow localhost to loopback into your local network.
sudo iptables -A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -j ACCEPTThis command will allow DNS Lookup.
sudo iptables -A INPUT -s (Internal IP Address/32) -j ACCEPT. This will allow your internal IP Address to be whitelisted.
sudo iptables -A OUTPUT -P icmp --icmp-type echo-request -j DROP. This command will allow the server to see the pings but will not respond back, this is very good for troubleshooting.
sudo iptables -P INPUT DROPThis command will drop everything else.
sudo iptables -Lthis will list all entries currently on the device
This setup is a simplified version, and can be made very complex by changing the order of how the rules are created.