Slackware HowTo

Basic firewall with iptables on Slackware

Simple and controlled filtering.

1. Base rules

Minimal example:

iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

2. Persistence

Save a script in /etc/rc.d/rc.firewall and make it executable.

3. Test

Keep SSH access before applying stricter rules.

4. Verify

iptables -L -n

Quick checklist

[ ] Steps completed
[ ] Config updated
[ ] Service tested
[ ] Restart/rollback ready
[ ] Logs checked

Back to Linux HowTo