#!/bin/bash
INET_IFACE="ppp0"
INET_IP=`ifconfig $INET_IFACE | awk '/inet addr/ {split ($2,A,":"); print A[2]}'`
IPTABLES="/sbin/iptables"
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ipt_helper
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_gre
modprobe ip_nat_pptp
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -F
$IPTABLES -X
$IPTABLES -t nat -F
$IPTABLES -t nat -A POSTROUTING -s 192.168.0.0/16 --out-interface $INET_IFACE -j SNAT --to-source $INET_IP