]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- added userspace and kernelspace PPPoE support
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 24 Aug 2002 16:05:52 +0000 (16:05 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 24 Aug 2002 16:05:52 +0000 (16:05 +0000)
- pass unit option to pppd (so now ifcfg-ppp5 with DEVICE=ppp5 will
  _always_ create ppp5 interface when it's not used yet)

svn-id: @1041

README
sysconfig/interfaces/ifcfg-description
sysconfig/network-scripts/functions.network
sysconfig/network-scripts/ifup-ppp

diff --git a/README b/README
index 3ad0859c24db26f097888f0afc562ea61af4379f..8d1c1c5da63bafbaaa2da74cd91a020dcdc52790 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-       $Id: README,v 1.9 2002/03/24 03:59:16 blues Exp $
+       $Id: README,v 1.10 2002/08/24 16:05:45 misiek Exp $
 
 rc-scripts is a derivative of the initscripts 3.78 release by
 RedHat Software, but with bugs removed and newer features added.
@@ -36,6 +36,7 @@ Other required or suggested packages:
   IrDA         irda-utils
   serial/ppp   ppp, dip, wvdial
   serial/slip  slattach
+  PPPoE                pppd + rp-pppoe (plugin or userspace program)
   
 Also you should know that format of interface configuration
 files is totally different from these used in RedHat/Mandrake
index 6a4f959759419f7618a00becec848e286b2eb5f3..daf0a74b551aff888cd4db3d7777dd8303e845cf 100644 (file)
@@ -1,4 +1,4 @@
-#      $Id: ifcfg-description,v 1.16 2002/08/22 13:21:22 misiek Exp $
+#      $Id: ifcfg-description,v 1.17 2002/08/24 16:05:50 misiek Exp $
 DEVICE=<name>
 [ BOOTPROTO={none|bootp|dhcp|pump} ]
   You can specify which dhcp client to use with the DHCP_CLIENT, if
@@ -117,6 +117,11 @@ elif       DEVICE=ppp* || DEVICE=sl* ; then
                        or by default use address specified by IP6_PRIM_IF
                        and REMIP6
                fi
+               PPPOE_DEV=<ethX> (PPP over Ethernet device)
+               PPPOE_KERNEL=yes|no (use or not kernel space PPPoE support)
+               PPPOE_OPT=<options> (used only with userspace pppoe program)
+               UNIT=yes|no (pass unit option to pppd (depends on DEVICE name)
+                            defaults to yes)
        fi
 
        if      DEVICE=sl* ; then       (SLIP)
index 567d377d5d36f263fc5e9b36797e7e4da856a08d..b8c855d03e6f34268a354d49ca2d76df37acc6e9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: functions.network,v 1.4 2002/08/21 21:30:42 misiek Exp $
+# $Id: functions.network,v 1.5 2002/08/24 16:05:52 misiek Exp $
 # 
 # This is not a shell script; it provides functions to network scripts
 # that source it.
@@ -425,10 +425,12 @@ if [ -f "/var/run/ppp-$DEVICE.pid" ] ; then
                 read REALDEVICE ; echo "REALDEVICE=$REALDEVICE"
              } < "/var/run/ppp-$DEVICE.pid"`
 fi
+
 if [ -z "$REALDEVICE" ] ; then
        REALDEVICE=$DEVICE
 fi
 }
+
 # following function setups advanced routing rules
 # Olgierd Pieczul <wojrus@pld.org.pl>
 setup_ip_rules () {
index ab599bcd49553f8f4c1cefdf2b8671a8bd5169ab..787f2599da59ad24e6ce3b5c9780170846b2ec58 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $Id: ifup-ppp,v 1.20 2002/07/13 16:25:08 misiek Exp $
+#      $Id: ifup-ppp,v 1.21 2002/08/24 16:05:52 misiek Exp $
 #
 # ifup-ppp script for pppd-2.3.5 (with persist & demand options) ver 0.2
 # Grzegorz Stanislawski <stangrze@open.net.pl>
@@ -49,39 +49,50 @@ if [ -z "${REPORTFILE}"  ] ; then
     REPORTFILE=/dev/null
 fi
 
-if is_no "${DIRECT_CONNECT}" || [ -z "${DIRECT_CONNECT}" ]; then
-    
-    PEERCONF=/etc/ppp/peers/${DEVNAME}
-    
-    if [ ! -f ${PEERCONF} ]; then
-       if [ -z "${WVDIALSECT}" ]; then
+if [ -n "${PPPOE_DEV}" ]; then
+    if is_yes "${PPPOE_KERNEL}"; then
+       modprobe -s -k pppoe
+       MODEMMODE="plugin rp-pppoe.so"
+       MODEMPORT="${PPPOE_DEV}"
+    else
+       MODEMMODE="pty"
+       MODEMPORT="pppoe -I ${PPPOE_DEV} ${PPPOE_OPT}"
+    fi
+else
+    if is_no "${DIRECT_CONNECT}" || [ -z "${DIRECT_CONNECT}" ]; then
+       
+       PEERCONF=/etc/ppp/peers/${DEVNAME}
+       
+       if [ ! -f ${PEERCONF} ]; then
+           if [ -z "${WVDIALSECT}" ]; then
            # XXX: REPORTFILE support is problematic here --misiek
-           [ -f "${CHATSCRIPT}" ] || CHATSCRIPT=/etc/sysconfig/interfaces/data/chat-${PARENTDEVNAME}
-           if [ ! -f "${CHATSCRIPT}" ]; then
-               nls '/etc/sysconfig/network-scripts/chat-%s does not exist' "${DEVNAME}"
-               nls 'ifup-ppp for %s exiting' "${DEVNAME}"
-               logger -p daemon.info -t ifup-ppp \
-               "$(nls '/etc/sysconfig/network-scripts/chat-%s does not exist for %s' "${DEVNAME}" "${DEVICE}")"
-               exit 1
+               [ -f "${CHATSCRIPT}" ] || CHATSCRIPT=/etc/sysconfig/interfaces/data/chat-${PARENTDEVNAME}
+               if [ ! -f "${CHATSCRIPT}" ]; then
+                   nls '/etc/sysconfig/network-scripts/chat-%s does not exist' "${DEVNAME}"
+                   nls 'ifup-ppp for %s exiting' "${DEVNAME}"
+                   logger -p daemon.info -t ifup-ppp \
+                       "$(nls '/etc/sysconfig/network-scripts/chat-%s does not exist for %s' "${DEVNAME}" "${DEVICE}")"
+                   exit 1
+               fi
            fi
-       fi
-       logger -s -p daemon.notice -t ifup-ppp "$(nls 'Setting up a new %s config file' "${PEERCONF}")"
-       if [ -f /etc/ppp/peers/${DEVICE} ]; then
-           cp -f /etc/ppp/peers/${DEVICE} ${PEERCONF}
-       else
-           touch ${PEERCONF}
-       fi
-       if [ "${WVDIALSECT}" ]; then
-           echo "connect \"/usr/bin/wvdial --chat ${WVDIALSECT} >> ${REPORTFILE} 2>&1 \"" >> ${PEERCONF}
-       else
-           if is_yes "${DEBUG}"; then
-               chatdbg="-v"
+           logger -s -p daemon.notice -t ifup-ppp "$(nls 'Setting up a new %s config file' "${PEERCONF}")"
+           if [ -f /etc/ppp/peers/${DEVICE} ]; then
+               cp -f /etc/ppp/peers/${DEVICE} ${PEERCONF}
+           else
+               touch ${PEERCONF}
+           fi
+           if [ "${WVDIALSECT}" ]; then
+               echo "connect \"/usr/bin/wvdial --chat ${WVDIALSECT} >> ${REPORTFILE} 2>&1 \"" >> ${PEERCONF}
+           else
+               if is_yes "${DEBUG}"; then
+                   chatdbg="-v"
+               fi
+               echo "connect \"/usr/sbin/chat $chatdbg -f ${CHATSCRIPT} -r ${REPORTFILE} ${chatdbg}\"" >> ${PEERCONF}
            fi
-           echo "connect \"/usr/sbin/chat $chatdbg -f ${CHATSCRIPT} -r ${REPORTFILE} ${chatdbg}\"" >> ${PEERCONF}
        fi
+       
+       opts="$opts call ${DEVNAME}"
     fi
-
-    opts="$opts call ${DEVNAME}"
 fi
 
 if [ -z "$HOLDOFF" ]; then
@@ -156,6 +167,7 @@ if is_yes "${IPX_PPP}"; then
        opts="$opts ipx-routing ${IPX_PPP_ROUTING}"
     fi
 fi
+
 if [ -n "${PAPNAME}" ] ; then
   opts="$opts user ${PAPNAME}"
 fi
@@ -171,10 +183,15 @@ elif is_no "${AUTH}"; then
   opts="$opts noauth"
 fi
 
+if ! is_no "${UNIT}"; then
+    UNIT=$(echo "${DEVICE}" | awk ' { gsub(/ppp/,NUL); print $0} ')
+    opts="$opts unit ${UNIT}"
+fi
+
 (logger -p daemon.info -t ifup-ppp \
-    $(nls 'pppd started for %s on %s at %s' "$DEVICE" "$MODEMPORT" "$LINESPEED") &)&
+    $(nls 'pppd started for %s on device %s at speed %s' "$DEVICE" "$MODEMPORT" "${LINESPEED:-(unspecified)} on unit ${UNIT}") &)&
 
-/usr/sbin/pppd $opts ${MODEMPORT} ${LINESPEED} \
+/usr/sbin/pppd $opts ${MODEMMODE} "${MODEMPORT}" ${LINESPEED} \
        ipparam ${DEVNAME} linkname ${DEVNAME} \
        ${PPPOPTIONS}
        
This page took 1.32294 seconds and 4 git commands to generate.