#
# pslave.conf	Here is the sample server configuration file.
#
# Version:	1.2.0  1999-XX-XX
#

#
# Hostname of the system.
#
conf.hostname	host.plug.ph
#
# IP address - if left empty, uses the IP address of the system (hostname).
# This is used as the "local" address for SLIP and PPP connections.
#
conf.ipno	10.0.0.1
#
# Lock directory - on FSSTND compliant systems it's /var/lock.
#
conf.lockdir	/var/lock
#
# Where to find the rlogin binary that accepts the "-i" flag.
#
#conf.rlogin	/usr/local/bin/rlogin-radius
#
# Where to find our patched pppd that has radius linked in.
#
conf.pppd	/usr/local/sbin/pppd-radius
#
# Where to find telnet. This can just be the system telnet. (Optional)
#
#conf.telnet	/usr/bin/telnet
#
# Where to find ssh. This can just be the system SSH. (Optional)
#
#conf.ssh	/usr/bin/ssh
#
# If you set this to "1", you can always login locally by putting a '!'
# before your loginname. Useful for emergencies when the RADIUS server is down.
#
conf.locallogins	1
#
# Logging stuff - this program can use a remote syslog daemon if needed.
# If you want to log locally leave the "syslog" field empty. The facility
# field is an integer between 0 and 7 and sets the syslog facility to
# local0-local7.
#
conf.syslog	127.0.0.1
conf.facility	6
#
# Directory where your scripts that set up IP filtering (typically using
# ipfwadmin) are stored. To invoke them, just add the RADIUS-attribute
# Framed-Filter-Id = "foo" to your profile, where foo is the name of script.
# 
conf.filterdir	/etc/portslave/filters

#
# Stripnames - if you set this to "1", leading "P", "S", "C", "L" or "!"
# characters and trailing ".slip", ".cslip" and ".ppp" strings will be
# stripped from the username before it is recorded in the system
# utmp and wtmp files (if sysutmp or syswtmp are turned on ofcourse)
#
conf.stripnames	0


##
## The all entry is used as a template for all others. This means that
## setting all.debug to 0, you set s0.debug, s1.debug, s2.debug etc.
## to 0. It also means that all these settings can be overridden on a
## per-port basis below.
##

#
# Debugging output to syslog. Set to 0 or 1. "1" is pretty verbose.
#
all.debug	1

#
# Authentication type - either "radius" or "none".
#
all.authtype    radius

#
# Authentication host and accounting host. We can have 2 of both. The
# first one is always tried three times before switching to the second one.
# They are alternately tried after that, upto maximum 10 times in total.
# Timeout is 3 seconds per query.
#
all.authhost1	<radius server ip>
all.accthost1	<radius server ip>
all.radtimeout 	3
#all.authhost2	backuphost.someisp.com
#all.accthost2	backuphost.someisp.com

# Realms.  Again, user@host login names are recognized, but the @host
# part is used to select different authentication/accounting hosts.
# In the first example, all four hosts are actually defined; in the
# second, there is only one authentication and one accounting host.
# Undefined hosts must be represented by empty strings.  The order
# is @realm authhost1 accthost1 authhost2 accthost2.
#
#all.realm     >-@flintstone fred wilma barney zelda
#all.realm     >-@duck donald louie "" ""
#all.realm     <+U uucpauth uucpacct "" ""
#
# '>' means that the @host part is a suffix, and '-' tells the program
# to strip the suffix if providing a login service.  '<' and '+' are
# counterparts to '>' and '-', as shown in the third example, which
# does what UUCPHACK has existed for.
#
# Realm definitions are special because subsequent definitions don't
# replace the previous ones, but add to them.
#

#
# The shared secret for RADIUS.
#
all.secret	secretkey
#
# Default protocol and host. This is for rlogin sessions.
#
all.protocol	ppp
all.host	host.plug.ph
#
# Default IP stuff. If you end the "ipno" with a "+", the portnumber will
# be added to the IP number. The IP number of a port is used when the RADIUS
# server doesn't send an IP number, or if it tells us to use a dynamic ipno.
#
# Leave the netmask at 255.255.255.255, unless your really know what
# you're doing.
#
all.ipno	10.0.0.2+
all.netmask	255.255.255.255
all.mtu		1500
#
# Standard message that is issued on connect.
#
all.issue       \n\
                Portslave Internet Services\n\
\n\
     Welcome to terminal server %h port S%p \n\
\n\
Customer Support: 123-555-1212     http://www.myisp.net/\n\
\n
# 
# Login prompt.
#
all.prompt	%h login: 
#
# Terminal type, for rlogin/telnet sessions.
#
all.term	vt100
#
# If you want portslave to update the utmp and/or wtmp files just
# like a regular getty/login, set these to 1.
#
all.sysutmp	1
all.syswtmp	0

##
## Options for the serial port.
##

#
# Porttype (passed to Radius for logging).
# 0 = async, 1 = sync, 2 = ISDN, 3 = ISDN-V120, 4 = ISDN-V110
#
all.porttype	0
#
# Speed. All ports are set to 8N1.
#
all.speed	57600
#
# Use this to initialize the modem.
#
# d == delay (1 sec), p == pause (0.1 sec), l == toggle DTR
# r == <CR>, l == <LF>
#
all.initchat	"" \d\l\dAT&F1 OK\r\n-ATZ-OK\r\n
#
# You can use either waitfor or aa.
#
all.waitfor	RING
#
# Chat string to get the modem to connect after waitfor.
# The @ sign matches (.*)[\r\n] in regexp code, the match is logged
# to Radius as Connection-Info.
#
all.answer	"" ATA CONNECT@
#
# Auto answer - if you set this to "1", the system will just wait for
# the DCD line to get high (this is not well tested). You won't get
# the connection info either.
#
all.aa		0
#
# You can use this chatstring to regulary check if the modem is still alive.
# Tiem is in minutes
#
all.checktime	60
all.checkchat	"" AT OK
#
# Flow control on this serial port:
#    hard - hardware, rts/cts
#    soft - software, CTRL-S / CTRL-Q
#    none.
#
all.flow	hard
#
# Use the DCD line or not (this sets CLOCAL if on). This means that the session
# will get hung up if the modem hangs up. Can be set to 0 or 1.
#
all.dcd		1
#
# PPP options - used if we autodetect a PPP session.
# Note that we set mru and mtu both to the MTU setting.

#pppd 2.3.x  -- Linux 2.2, or Linux 2.0 patched
all.autoppp	proxyarp modem asyncmap 0 %i: \
		noipx noccp login auth require-pap refuse-chap \
		mtu %t mru %t \
		ms-dns <dns ip> \
		uselib /usr/local/lib/libpsr.so

#
# PPP options - User already authenticated and service type is PPP.
#

#pppd 2.3.x  -- Linux 2.2, or Linux 2.0 patched
all.pppopt	proxyarp modem asyncmap 0 %i:%j \
		noipx noccp mtu %t mru %t netmask %m \
		idle %I maxconnect %T \
		ms-dns <dns ip> \
		uselib /usr/local/lib/libpsr.so

##
## Tty names are s0...s63. For every port we need to define a tty port, and
## an IP number for when radius tells us to pick one ourself. Unless you
## use the IP pool option mentioned above (IP number with "+" appended).
##
## Note that you can change _all_ of the above settings that start
## with all.xxxx on a per-port basis, such as issue, prompt etc.
##
s0.tty		ttyS0
s1.tty		ttyS1

s31.tty		tty9
s31.speed	9600
s31.flow	soft
s31.dcd		0
s31.initchat	""
s31.waitfor	""
s31.answer	""

