diff options
-rw-r--r-- | etc/Makefile | 5 | ||||
-rw-r--r-- | etc/defaults/rc.conf | 9 | ||||
-rw-r--r-- | etc/network.subr | 19 | ||||
-rw-r--r-- | etc/ppp/ppp.conf | 36 | ||||
-rw-r--r-- | etc/rc.d/netoptions | 19 | ||||
-rw-r--r-- | etc/rc.d/network1 | 19 | ||||
-rw-r--r-- | etc/rc.d/network2 | 19 | ||||
-rw-r--r-- | etc/rc.d/network3 | 19 | ||||
-rw-r--r-- | etc/rc.d/routing | 19 | ||||
-rw-r--r-- | etc/rc.network | 19 | ||||
-rw-r--r-- | release/sysinstall/network.c | 14 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 4 | ||||
-rw-r--r-- | share/man/man5/rc.conf.5 | 26 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/network.c | 14 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 4 |
16 files changed, 226 insertions, 23 deletions
diff --git a/etc/Makefile b/etc/Makefile index 9ead107..ffb7a7d 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $Id: Makefile,v 1.200 1999/07/09 05:30:33 obrien Exp $ +# $Id: Makefile,v 1.201 1999/07/10 18:02:12 iwasaki Exp $ SUBDIR= sendmail @@ -24,6 +24,7 @@ MTREE= BSD.include.dist BSD.local.dist BSD.root.dist BSD.usr.dist \ BSD.var.dist BSD.x11.dist NAMEDB= PROTO.localhost.rev named.conf named.root make-localhost PPPCNF= ppp.deny ppp.shells.sample +PPPCF2= ppp.conf NOSPAM= Makefile README @@ -79,6 +80,8 @@ distribution: ${NAMEDB} ${DESTDIR}/etc/namedb cd ${.CURDIR}/ppp; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ ${PPPCNF} ${DESTDIR}/etc/ppp + cd ${.CURDIR}/ppp; ${INSTALL} -c -o root -g ${BINGRP} -m 600 \ + ${PPPCF2} ${DESTDIR}/etc/ppp cd ${.CURDIR}/mail; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ ${NOSPAM} ${DESTDIR}/etc/mail ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \ diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index fc1d7ba..d7aa93a 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -9,7 +9,7 @@ # # All arguments must be in double or single quotes. # -# $Id: rc.conf,v 1.21 1999/07/16 09:26:53 jkh Exp $ +# $Id: rc.conf,v 1.22 1999/07/18 09:58:01 jkh Exp $ ############################################################## ### Important initial Boot-time options #################### @@ -58,6 +58,13 @@ sppp_interfaces="" # List of sppp interfaces. #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). diff --git a/etc/network.subr b/etc/network.subr index d0eec1a..007d0f9 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/ppp/ppp.conf b/etc/ppp/ppp.conf new file mode 100644 index 0000000..63ddd33 --- /dev/null +++ b/etc/ppp/ppp.conf @@ -0,0 +1,36 @@ +################################################################# +# PPP Sample Configuration File +# Originally written by Toshiharu OHNO +# Simplified 5/14/1999 by wself@cdrom.com +# +# $Id$ +################################################################# + +default: + + # + # Make sure that "device" references the correct serial port + # for your modem. (cuaa0 = COM1, cuaa1 = COM2) + # + + set device /dev/cuaa1 + + set log Phase Chat LCP IPCP CCP tun command + set speed 115200 + set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" + + set timeout 120 + set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 + add default HISADDR + enable dns + +papchap: + + # + # edit the next three lines and replace the items in caps with + # the values which have been assigned by your ISP. + # + + set phone PHONE_NUM + set authname USERNAME + set authkey PASSWORD diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index d0eec1a..007d0f9 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index d0eec1a..007d0f9 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index d0eec1a..007d0f9 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index d0eec1a..007d0f9 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/rc.d/routing b/etc/rc.d/routing index d0eec1a..007d0f9 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/etc/rc.network b/etc/rc.network index d0eec1a..007d0f9 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -1,6 +1,6 @@ #!/bin/sh - # -# $Id: rc.network,v 1.49 1999/07/08 18:56:02 peter Exp $ +# $Id: rc.network,v 1.50 1999/07/16 09:26:52 jkh Exp $ # From: @(#)netstart 5.9 (Berkeley) 3/30/91 # Note that almost all the user-configurable behavior is no longer in @@ -144,6 +144,23 @@ network_pass1() { 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" = X"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 diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c index c71f76b..8edf030 100644 --- a/release/sysinstall/network.c +++ b/release/sysinstall/network.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: network.c,v 1.36 1999/05/19 10:49:43 jkh Exp $ + * $Id: network.c,v 1.37 1999/07/18 10:18:05 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -246,7 +246,7 @@ startPPP(Device *devp) close(fd2); } if (!Fake) - fp = fopen("/etc/ppp/ppp.conf", "w"); + fp = fopen("/etc/ppp/ppp.conf", "a"); else fp = fopen("/dev/stderr", "w"); if (!fp) { @@ -268,7 +268,7 @@ startPPP(Device *devp) dialog_clear_norefresh(); pulse = dialog_yesno("", "Does your telephone line support tone dialing?", -1, -1); } - fprintf(fp, "default:\n"); + fprintf(fp, "\ninstall:\n"); fprintf(fp, " set speed %s\n", speed); fprintf(fp, " set device %s\n", devp->devname); fprintf(fp, " set ifaddr %s %s\n", myaddr, provider); @@ -282,10 +282,14 @@ startPPP(Device *devp) fprintf(fp, " set authkey %s\n", authkey); fprintf(fp, " set phone %s\n", phone); } - if (fchmod(fileno(fp), 0640) != 0) + if (fchmod(fileno(fp), 0600) != 0) msgConfirm("Warning: Failed to fix permissions on /etc/ppp/ppp.conf !"); fclose(fp); + /* Make the ppp config persistent */ + variable_set2(VAR_PPP_ENABLE, "YES", 0); + variable_set2(VAR_PPP_PROFILE, "install", 0); + if (!Fake && !file_readable("/dev/tun0") && mknod("/dev/tun0", 0600 | S_IFCHR, makedev(52, 0))) { msgConfirm("Warning: No /dev/tun0 device. PPP will not work!"); return 0; @@ -318,7 +322,7 @@ startPPP(Device *devp) } else msgDebug("ppp: Unable to get the terminal attributes!\n"); - execlp("ppp", "ppp", (char *)NULL); + execlp("ppp", "ppp", "install", (char *)NULL); msgDebug("PPP process failed to exec!\n"); exit(1); } diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 0ed5308..76d1c00 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.170 1999/07/18 10:18:06 jkh Exp $ + * $Id: sysinstall.h,v 1.171 1999/07/19 10:06:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -148,6 +148,8 @@ #define VAR_PCNFSD "pcnfsd" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" +#define VAR_PPP_ENABLE "ppp_enable" +#define VAR_PPP_PROFILE "ppp_profile" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 66dae56..bfc5745f 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: rc.conf.5,v 1.35 1999/07/12 19:24:53 mpp Exp $ +.\" $Id: rc.conf.5,v 1.36 1999/07/16 09:22:01 jkh Exp $ .\" .Dd April 26, 1997 .Dt RC.CONF 5 @@ -218,6 +218,30 @@ ifconfig_ed0_alias4="inet 127.0.0.254 netmask 0xffffffff" .Ed Then note that alias4 would \fBnot\fR be added since the search would stop with the missing alias3 entry. +.It Ar ppp_enable +(bool) If set to +.Ar YES , +run the +.Xr ppp 8 +daemon. +.It Ar ppp_mode +(str) Mode in which to run the +.Xr ppp 8 +daemon. Accepted modes are +.Ar auto , ddial , direct +and +.Ar dedicated . +See the manual for a full description. +.It Ar ppp_alias +(bool) If set to +.Ar YES , +enables packet aliasing. Used in conjunction with +.Ar gateway_enable +allows hosts on private network addresses access to the Internet using +this host as a network address translating router. +.It Ar ppp_profile +(str) The name of the profile to use from +.Ar /etc/ppp/ppp.conf . .It Ar rc_conf_files (str) This option is used to specify a list of files that will override the settings in diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 0ed5308..76d1c00 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.170 1999/07/18 10:18:06 jkh Exp $ + * $Id: sysinstall.h,v 1.171 1999/07/19 10:06:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -148,6 +148,8 @@ #define VAR_PCNFSD "pcnfsd" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" +#define VAR_PPP_ENABLE "ppp_enable" +#define VAR_PPP_PROFILE "ppp_profile" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c index c71f76b..8edf030 100644 --- a/usr.sbin/sysinstall/network.c +++ b/usr.sbin/sysinstall/network.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: network.c,v 1.36 1999/05/19 10:49:43 jkh Exp $ + * $Id: network.c,v 1.37 1999/07/18 10:18:05 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -246,7 +246,7 @@ startPPP(Device *devp) close(fd2); } if (!Fake) - fp = fopen("/etc/ppp/ppp.conf", "w"); + fp = fopen("/etc/ppp/ppp.conf", "a"); else fp = fopen("/dev/stderr", "w"); if (!fp) { @@ -268,7 +268,7 @@ startPPP(Device *devp) dialog_clear_norefresh(); pulse = dialog_yesno("", "Does your telephone line support tone dialing?", -1, -1); } - fprintf(fp, "default:\n"); + fprintf(fp, "\ninstall:\n"); fprintf(fp, " set speed %s\n", speed); fprintf(fp, " set device %s\n", devp->devname); fprintf(fp, " set ifaddr %s %s\n", myaddr, provider); @@ -282,10 +282,14 @@ startPPP(Device *devp) fprintf(fp, " set authkey %s\n", authkey); fprintf(fp, " set phone %s\n", phone); } - if (fchmod(fileno(fp), 0640) != 0) + if (fchmod(fileno(fp), 0600) != 0) msgConfirm("Warning: Failed to fix permissions on /etc/ppp/ppp.conf !"); fclose(fp); + /* Make the ppp config persistent */ + variable_set2(VAR_PPP_ENABLE, "YES", 0); + variable_set2(VAR_PPP_PROFILE, "install", 0); + if (!Fake && !file_readable("/dev/tun0") && mknod("/dev/tun0", 0600 | S_IFCHR, makedev(52, 0))) { msgConfirm("Warning: No /dev/tun0 device. PPP will not work!"); return 0; @@ -318,7 +322,7 @@ startPPP(Device *devp) } else msgDebug("ppp: Unable to get the terminal attributes!\n"); - execlp("ppp", "ppp", (char *)NULL); + execlp("ppp", "ppp", "install", (char *)NULL); msgDebug("PPP process failed to exec!\n"); exit(1); } diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 0ed5308..76d1c00 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.170 1999/07/18 10:18:06 jkh Exp $ + * $Id: sysinstall.h,v 1.171 1999/07/19 10:06:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -148,6 +148,8 @@ #define VAR_PCNFSD "pcnfsd" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" +#define VAR_PPP_ENABLE "ppp_enable" +#define VAR_PPP_PROFILE "ppp_profile" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" |