For the life of me I can't seem to remember these simple commands to edit my IPTables so I just wanted to document the few that I seem to be using the most:
View current rules
View a list of current rules
iptables -L
Insert a new rule
This will insert a new rule in the INPUT chain in the number 5 slot:
iptables -I INPUT 5 -p tcp --dport [port] -j ACCEPT
Delete specific rule
This will delete rule number 5 from the list. Change the 5 to whatever number you need to delete
iptables -D INPUT 5
Save rules to a file
Make sure to save the rules to a file so they are applied upon boot. Note that I needed to use the "sh -c" option for sudo or you will get a permission denied error
sudo sh -c "iptables-save >/etc/iptables.rules"
I've been using Drupal for quite a while (since verion 4.x) both as a hobby and building websites for clients.