Add optional route to pptp server.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 19 Feb 2011 19:47:38 +0000 (20:47 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 19 Feb 2011 19:47:38 +0000 (20:47 +0100)
html/cgi-bin/pppsetup.cgi
src/initscripts/init.d/networking/red

index 443c201..4c7bb8c 100644 (file)
@@ -709,6 +709,11 @@ print <<END
         <td width='25%'>My Netconfig</td>
         <td colspan='3'><input size=50 type='text' name='PPTP_NICCFG' value='$pppsettings{'PPTP_NICCFG'}' /></td>
 </tr>
+<tr>
+        <td width='25%'>PPTP Route&nbsp;<img src='/blob.gif' alt='*' /></td>
+        <td colspan='3'><input size=50 type='text' name='PPTP_ROUTE' value='$pppsettings{'PPTP_ROUTE'}' /></td>
+</tr>
+
 END
 ;
 }
@@ -927,6 +932,7 @@ sub initprofile
         $pppsettings{'VCI'} = '32';
         $pppsettings{'PPTP_PEER'} = '10.0.0.138';
        $pppsettings{'PPTP_NICCFG'} = '10.0.0.140/24 broadcast 10.0.0.255';
+       $pppsettings{'PPTP_ROUTE'} = '';
         $pppsettings{'PROTOCOL'} = 'RFC2364';
         $pppsettings{'MTU'} = '1492';
         $pppsettings{'MRU'} = '1492';
index 0c41663..1e4af55 100644 (file)
@@ -363,6 +363,10 @@ case "${1}" in
                                        fi
                                fi
                                ip link set ${PPP_NIC} up
+                               if [ -n "${PPTP_ROUTE}" ]; then
+                                       boot_mesg "Set route ${PPTP_ROUTE} to pptp server..."
+                                       route add ${PPTP_ROUTE}
+                               fi
                        else
                                boot_mesg "Bringing up the PPP via ${TYPE} on ${COMPORT}..."
                        fi
@@ -551,6 +555,10 @@ case "${1}" in
                        fi
                fi
 
+               if [ -n "${PPTP_ROUTE}" ]; then
+                       route del ${PPTP_ROUTE}
+               fi
+
                if [ "$DEVICE" != "${GREEN_DEV}" ] && [ "$DEVICE" != "" ]; then
                        link_status=`ip link show $DEVICE.${INET_VLAN} 2> /dev/null`
                        if [ -n "${link_status}" ]; then