#
# $Id: home-dialup.conf,v 1.4 2003/10/12 13:43:42 ktsaou Exp $
#
#
# THIS IS AN OLD EXAMPLE SCRIPT, LEFT HERE FOR HISTORICAL REASONS 
# PLEASE USE THE lan-gateway.conf EXAMPLE.
#
#
# Configuration file for a home router with one ethernet interface (eth0)
# for the home LAN and a PPP interface for connecting to the Internet.
#
# The PPP interface gets a dynamic (random) IP address and the LAN works
# with private IP addresses.
#
# The PCs on the local LAN are trusted. They can access all the services
# this Linux box is running.
#
# This script can also setup a transparent cache for all the PCs on the
# local LAN.

version 5

# ----------------------------------------------------------------------

# Public services for the Internet your linux box should allow.
internet_services="smtp http"

# At what frequency to accept requests from the internet?
internet_requests="10/sec"

# The Ethernet interface your Linux talks with other PCs in your LAN.
home_interface="eth0"

# The port of a squid proxy server on this Linux box. If you set this
# you will get a transparent web cache.
# If you don't have this, empty this field.
proxy_port="3128"


# ----------------------------------------------------------------------
# Normally, you don't have to edit anything bellow.

# Setup a transparent proxy on this host.
if [ ! -z "${proxy_port}" ]
then
	iptables -t nat -A PREROUTING -i ${home_interface} -p tcp --dport 80 -j REDIRECT --to-port ${proxy_port}
fi


# trusted LAN for local clients
interface "${home_interface}" home
	policy accept


# PPP for internet traffic
interface ppp+ internet src not "${UNROUTABLE_IPS}"
	protection strong ${internet_requests}
	
	# Speed up idents
	server ident reject with tcp-reset
	
	# Public Services
	server "${internet_services}" accept
	
	# This is a workstation
	client all accept


# Route traffic for the clients on the LAN
router myrouter inface ppp+ outface "${home_interface}"
	
	# masquerade on ppp+
	masquerade reverse
	
	# route all client traffic
	client all accept
