
#-----------------------------------------------------------------------
# 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-servers. 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.
#
# 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>
#             Initial version copied from 030-pptpvpn-hostports
#
#-----------------------------------------------------------------------
# MODULE CONFIGURATION
#-----------------------------------------------------------------------
#
#n# pptp
#a# accept
#t# servers
#i# cluster
#m# 123
#
#   |--------------------------------------------------------------------|
#d# pptp (Port 1723 TCP, Protocol 43)
#d# Hostnames of other servers you'll be communicating with via a PPTP VPN
#d# You must declare your VPN interface as either PRIVATE or PUBLIC !
#   |--------------------------------------------------------------------|
#
#-----------------------------------------------------------------------
# START OF MODULE CODE
#-----------------------------------------------------------------------

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

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

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

unset module_name module_type service_name service_port host

