All pastes #458003 Raw Edit

Stuff

public text v1 · immutable
#458003 ·published 2007-04-25 17:51 UTC
rendered paste body
IPTABLES="/sbin/iptables"       ## Location of IP Tables
EXTERNAL="eth0"                 ## External Interface
INTERNAL="eth1"                 ## Internal Interface

$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F #ignore if you get an error here
$IPTABLES -X #deletes every non-builtin chain in the table
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -m state --state NEW -i ! $EXTENAL -j ACCEPT
$IPTABLES -P INPUT DROP

$IPTABLES -A FORWARD -i eth0 -o $INTERNAL -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i eth1 -o $EXTERNAL -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTENAL -j MASQUERADE
$IPTABLES -A FORWARD -i eth0 -o $EXTENAL -j REJECT