#!/bin/sh

IPTABLES="/sbin/iptables"

$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT
$IPTABLES -t mangle -P PREROUTING ACCEPT
$IPTABLES -t mangle -P OUTPUT ACCEPT

$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F

$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X

#poff dsl-provider
iptables -t filter -F
iptables -I INPUT -p tcp -s 127.0.0.1 --dport 0:1023 -j ACCEPT
iptables -A INPUT -p tcp -s! 192.168.0.0/24 --dport 0:1023 -j DROP
iptables -t nat -F
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
sysctl -w net.ipv4.ip_forward=1
#pon dsl-provider

#echo "1" > /proc/sys/net/ipv4/ip_forward
#$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#modprobe ip_nat_ftp
