On Mon, Jul 05, 1999 at 08:59:41PM +0100, Brian Somers wrote:
> [-current cc'd - please don't make this a big thread !]
> /etc/start_if.tun0 with an ``exec ppp ...''.  This starts things up 
> at the correct point.
> 
> However, maybe it's time for a knob in rc.conf ?  Something like
> 
> ppp_enable="NO"         # Start user-ppp
> ppp_alias="YES"         # Packet aliasing (NAT/masquerading)
> ppp_mode="auto"         # Usually auto or ddial
> ppp_profile="papchap"   # Which profile to read from /etc/ppp/ppp.conf
> 
> We'd also need a default /etc/ppp/ppp.conf that contains a papchap 
> profile as this seems to be what most ISPs give you these days.  I'd 
> also include a commented-out ``set login'' with an appropriate 
> comment.  Sysinstall may need to be adjusted too...
> 
> Suggestions/objections ?  If not, I'll commit soon (unless you want 
> to do the work Joe ;*)

Something like this should do it.  It may be nice to also allow the
authname/authkey to be specified on the command line so that they
can easily be set in rc.conf, by hand or by sysinstall.

Joe
-- 
Josef Karthauser        FreeBSD: How many times have you booted today?
Technical Manager       Viagra for your server (http://www.uk.freebsd.org)
Pavilion Internet plc.  [[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]]
--- /etc/defaults/rc.conf       Wed Jun 30 22:02:32 1999
+++ rc.conf     Tue Jul  6 23:39:13 1999
@@ -50,6 +50,13 @@
 #sppp_interfaces="isp0"                # example: sppp over ISDN
 #spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' 
hisauthname=some-gw hisauthsecret='another secret'"
 
+# Use ppp configuration.
+ppp_enable="NO"                # Start user-ppp (or NO).
+ppp_mode="auto"                # Choice of "auto", "ddial", "direct" or "dedicated".
+                       # For details see man page for ppp(8). Default is auto.
+ppp_alias="YES"                # Packet aliasing (NAT/masquerading) or NO.
+ppp_profile="papchap"  # Which profile to use from /etc/ppp/ppp.conf.
+
 ### Network daemon (miscellaneous) & NFS options: ###
 syslogd_enable="YES"           # Run syslog daemon (or NO).
 syslogd_flags=""               # Flags to syslogd (if enabled).
--- rc.network-orig     Tue Jul  6 20:19:26 1999
+++ rc.network  Tue Jul  6 22:24:50 1999
@@ -128,6 +128,23 @@
        fi
     fi
 
+    # Warm up user ppp if required.
+    if [ "X$ppp_enable" = X"YES" ]; then
+           # Establish ppp mode.
+           if [ "X$ppp_mode" != X"ddial" -a "X$ppp_mode" != X"direct" \
+               -a "X$ppp_mode" != X"dedicated" ]; then \
+               ppp_mode="auto";
+           fi
+           ppp_command="-${ppp_mode} ";
+
+           # Switch on alias mode?
+           if [ "X$ppp_alias" = "YES" ]; then
+               ppp_command="${ppp_command} -alias";
+           fi
+
+           echo -n 'Starting ppp: '; ppp ${ppp_command} ${ppp_profile}
+    fi
+
     # Additional ATM interface configuration
     if [ -n "${atm_pass1_done}" ]; then
            atm_pass2

Reply via email to