Linux IPTables: How to Add Firewall Rules (With Allow SSH Example) | Linux Today

Linux IPTables: How to Add Firewall Rules (With Allow SSH Example)

Written By
Web Webster
Web Webster
Feb 17, 2011

“This article explains how to add iptables firewall rules using
the “iptables -A” (append) command.

“”-A” is for append. If it makes it easier for you to remember
“-A” as add-rule (instead of append-rule), it is OK. But, keep in
mind that “-A” adds the rule at the end of the chain.

“Again, it is very important to remember that -A adds the rule
at the end.

“Typically the last rule will be to drop all packets. If you
already have a rule to drop all packets, and if you try to use “-A”
from the command-line to create new rule, you will end-up adding
the new rule after the current “drop all packets” rule, which will
make your new rule pretty much useless.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.