Currently I have a debian install with a shell script which has the following content (as an example):
# Setup iptables
IPT="/sbin/iptables"
# Flush old rules, old custom tables
$IPT --flush
$IPT --delete-chain
# Set default policies for all three default chains
$IPT -P INPUT DROP
$IPT -P FORWARD DROP
$IPT -P OUTPUT ACCEPT
I was wondering if, instead of putting these rules in a shell script, I could have them in a file such as iptables.rules instead? This raises two further questions:
- Would I need to modify the contents of the script
- Where would I need to link the rules file to