IPTABLES: basic rules

Nowadays, It’s very important to get a fully working/firewall on your computer or in which you put your hands. I used to use Firestarter in my Debian’s Based System, But although is very functional, I didn’t like the way to apply the rules and manage the FORWARD and OUPUT rules as well. To manage your firewall directly with iptables you can read this and find it out in a simple way.

I supose you already have iptables installed in your system.

Previously to set up rules:

# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

General Rules:

# iptables -P INPUT DROP
# iptables -P FORWARD DROP
# iptables -P OUTPUT ACCEPT

Examples of rules:

# iptables -A INPUT -d (server address) -p FTP --dport 22 -j ACCEPT
# iptables -A INPUT -s 172.0.0.2 -d (server address) -p ICMP -j ACCEPT
# iptables -A INPUT -d (server address) -p ICMP -j DROP
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s