
#-----------------------------------------------------------------------
# README
#-----------------------------------------------------------------------
#
# This module supports the PPTP VPN, typically used by MicroSoft and other
# tunneling software.
#
# To install, copy this file to /etc/firewall-modules/public/services/
# 030-pptp-clients. Since VPN bandwidth use may be very high, it's 
# preferable to keep this module near the top. Execute rc.firewall with
# the --update-config parameter. This will add the new options to the 
# configuration file.
#
# Make sure you add the following line to the ip-up script which is
# run after the pptp client connects, to ensure rcf gets the forwarding
# and input chains correct:
#	/sbin/route add -host $5 gw $4
#
# References:
# http://poptop.lineo.com/
# http://www.vibrationresearch.com/pptpd/pptpd-FAQ.txt
#-----------------------------------------------------------------------
# CHANGES
#-----------------------------------------------------------------------
#
# 2001-04-21  Jean-Sebastien Morisset <jsmoriss@mvlan.net>
#             Changed Accept_Hostports function call to Hostports.
# 2001-04-13  Dougal Holmes <dholmes@bigpond.net.au>
#             Updated to use Accept_Hostports function
#             Migrated to create client and server modules
# 2001-02-18  Dougal Holmes <dholmes@bigpond.net.au>
#             Fixed error in call to Option_Value
# 2001-02-15  Edwin ten Brink <edwin@privateer.student.utwente.nl>
#             Added a few cosmetic changes (v5.1 style)
# 2001-02-15  Dougal Holmes <dholmes@bigpond.net.au>
#             Initial module copied from ipsecvpn for v5.0.
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#n# pptp
#a# accept
#t# clients
#i# cluster
#m# 123
#
#   |--------------------------------------------------------------------|
#d# pptp (Port 1723 TCP, Protocol 43)
#d# Hostnames of PPTP clients you'll be communicating with via PPTP
#d# You must declare the PPTP interface as either PUBLIC or PRIVATE !
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

module_name="pptp"	# module name used in options
module_type="clients"	# the module type (clients, servers, etc.)
service_name="PPTP"	# displayed on-screen
service_port="1723"	# port number for this service

#-----------------------------------------------------------------------
# PoPToP VPN (Port 1723, Protocol 43)
#-----------------------------------------------------------------------

for host in `Option_Value accept $INTOPT $module_name $module_type`
do
	Hostports accept local tcp "$service_name" $host $service_port
	ipchains -A $INCHAIN  -j ACCEPT -p 47 -s $host   -d $IPADDR $LOG
	ipchains -A $OUTCHAIN -j ACCEPT -p 47 -s $IPADDR -d $host   $LOG
done

unset module_name module_type service_name service_port host

