- Code: Select all
iptables-save
this shows the present firewall (contrary to what you may think: It doesn't "save" anything, it just dumps to the screen! you CAN save it to a file and use it to regenerate the present status by using iptables-restore on that saved file).
note that when you add a new rule at the top, it executes first. if your first rule is "drop all packets", the following "accept these ones" never get a chance to execute.
set your INPUT chain to have DROP as the last item. alternately, you can set the default action for the INPUT chain to be DROP, which will automatically drop any packet that gets to the end without matching a rule.
or you could follow the instructions for installing Dynamic Good Guys, which describes how to set up your system as a whitelisted system before the install (if you skip the install, all you've done is what your goal is: locked down the system and allow only whitelisted IPs to access the server). any whitelisted IPs will have full access, including mysql.