#!/bin/sh
#
# /etc/ppp/service/masq
#
# Script to start and stop IP-Masquerading. IP-Masquerading is a way to
# connect several hosts through one gateway (router) to the internet.
# Read the IP-Masquerading-howto for more information.
#

# Just add the netmask of your Subnet here, to make this work 
NETMASK=192.168.10.0

if [ "$1" = "start" ] ; then
  /sbin/ipfwadm -F -p deny
  /sbin/ipfwadm -F -a m -S $NETMASK/24 -D 0.0.0.0/0
  /sbin/ipfwadm -F -a m -S 0.0.0.0/0 -D $NETMASK/24
fi

if [ "$1" = "stop" ] ; then
  /sbin/ipfwadm -F -d m -S $NETMASK/24 -D 0.0.0.0/0
  /sbin/ipfwadm -F -d m -S 0.0.0.0/0 -D $NETMASK/24
fi
