rendered paste body#!/bin/bash
# iptables configuration file
# Flush all current rules
iptables -F
# Set default policies from INPUT, FORWARD and OUTPUT chains
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# Set ping limits
iptables -A INPUT -p icmp -m limit --limit 1/second --limit-burst 5 -j ACCEPT
# Set exceptions for services
# iptables -A INPUT -p tcp -s 192.168.0.0/24 --dport 22 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -m limit --limit 6/minute -j ACCEPT
# iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# Set access for localhost
iptables -A INPUT -i lo -j ACCEPT
# Print new settings
clear
iptables -vL