pastebin

Private paste #68683: Firewall script -- week 1

#!/bin/sh

IPT=/sbin/iptables

$IPT -F

#policies

$IPT -P OUTPUT ACCEPT
$IPT -P INPUT DROP
$IPT -P FORWARD DROP


#allowed inputs

$IPT -A INPUT --in-interface lo -j ACCEPT
$IPT -A INPUT -p tcp --dport 22 -j ACCEPT
$IPT -A INPUT -p tcp --dport 80 -j ACCEPT


#allow responses

$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Private
Wrap long lines

1 + 2 =