#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/rc470.pppoe_server - configuration of PPPoE-Server # # Creation: 25.02.2006 tobiasw # Last Update: $Id$ #---------------------------------------------------------------------------- case $OPT_PPPOE_SERVER in yes) begin_script PPPoE-Server "starting pppoe-server ..." ip link set $PPPOE_SERVER_ETH mtu 1500 up # set mtu to 1500 debug='' pppoetype='' case "$PPPOE_SERVER_DEBUG" in yes) debug='debug' ;; esac pppoe_server_dev=$PPPOE_SERVER_ETH # case $pppoe_server_dev in # br*|dummy*) # pppoe_server_dev="nic-$pppoe_server_dev" # ;; # esac if [ 0$PPPOE_SRV_USER_N -eq 0 ]; then auth=noauth else auth=auth for i in `seq 1 $PPPOE_SRV_USER_N`; do eval user="\$PPPOE_SRV_USER_${i}_NAME" eval pass="\$PPPOE_SRV_USER_${i}_PASS" echo "\"$user\" * \"$pass\" *" done >> /etc/ppp/pap-secrets fi case "$PPPOE_SERVER_TYPE" in "sync") do_modprobe ppp_synctty do_modprobe n_hdlc pppoetype='-s' ;; "async") do_modprobe ppp_async ;; "in_kernel") do_modprobe pppoe pppoetype='-k' ;; esac case x$PPPOE_SERVER_MTU in x) pppoe_mtu= ;; *) pppoe_mtu="mtu $PPPOE_SERVER_MTU" ;; esac case x$PPPOE_SERVER_MRU in x) pppoe_mru= ;; *) pppoe_mru="mru $PPPOE_SERVER_MRU" ;; esac cat < /etc/ppp/pppoe-server-options $auth $debug ms-dns $PPPOE_SERVER_DNS1 ms-dns $PPPOE_SERVER_DNS2 $pppoe_mru $pppoe_mtu EOF pppoe-server -I $pppoe_server_dev -L $PPPOE_SERVER_LOCAL_IP -R $PPPOE_SERVER_REMOTE_IP $pppoetype # . /etc/rc.d/dsl-circuit-common if [ -f /var/run/next_ppp_device ] then ppp_idx=`cat /var/run/next_ppp_device` else ppp_idx=0 fi echo $ppp_idx > /var/run/next_ppp_device net_alias_add pppoe-server ppp$ppp_idx end_script ;; esac