Basic Firewall



# Flush the tables to apply changes
iptables -F

# Default policy to drop 'everything' but our output to internet
iptables -P FORWARD DROP
iptables -P INPUT   DROP
iptables -P OUTPUT  ACCEPT

# Allow established connections (the responses to our outgoing traffic)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow local programs that use loopback (Unix sockets)
iptables -A INPUT -s -d -i lo -j ACCEPT

# Uncomment this line to allow incoming SSH/SCP conections to this machine,
# for traffic from (you can use also use a network definition as
# source like
# iptables -A INPUT -s -p tcp --dport 22 -m state --state NEW -j ACCEPT

Twitter Digg Delicious Stumbleupon Technorati Facebook

Comments are closed.

Random Pages By Best Accounting Services