#---------------------------------------------------------------------------- # /etc/rc.d/rc340.circuits.fcdsl - configuration of Fritz!Card DSL # # Creation: 28.05.2003 ow # Last Update: $Id$ #---------------------------------------------------------------------------- load_capi () { do_modprobe capi mkdir /dev/capi mount -t capifs -omode=0666 capifs /dev/capi } if [ "$OPT_FRITZDSL" = "yes" ] then begin_script CIRCUITS_FCDSL "starting fcdsl ..." : ${FRITZDSL_NF_MSS:=MTU} if [ "$OPT_ISDN" != yes ] then load_capi elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -lt 100 ] then load_capi elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -gt 199 ] then load_capi fi case "$FRITZDSL_TYPE" in fcdsl) if [ "$OPT_ISDN" != yes ] then do_modprobe fcdsl /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fdslbase.bin fi controller=2 ;; fcdsl2) if [ "$OPT_ISDN" != yes ] then do_modprobe fcdsl2 /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fds2base.bin fi controller=2 ;; fcdslsl) do_modprobe fcdslsl if [ "$OPT_ISDN" != yes ] then controller=1 elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -lt 100 ] then controller=1 elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -gt 199 ] then controller=1 else controller=2 fi /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fdssbase.bin "$controller" ;; fcdslusb) if [ "$OPT_ISDN" != yes ] then do_modprobe fcdslusb /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fdsubase.frm fi controller=2 ;; fcdslusb2) if [ "$OPT_ISDN" != yes ] then do_modprobe fcdslusb2 /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fds2base.frm fi controller=2 ;; fcdslslusb) do_modprobe fcdslslusb if [ "$OPT_ISDN" != yes ] then controller=1 elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -lt 100 ] then controller=1 elif [ "$OPT_ISDN" = yes -a "$ISDN_TYPE" -gt 199 ] then controller=1 else controller=2 fi /sbin/avmcapictrl load /usr/lib/isdn/$kernel_major/fdlubase.frm "$controller" ;; esac case "$FRITZDSL_PROVIDER" in U-R2|ECI) vpi=1 vci=32 protocol=adslpppoe ;; Siemens) vpi=130 vci=32 protocol=adslpppoe ;; Switzerland|Belgium|Netcologne) vpi=8 vci=35 protocol=adslpppoe ;; Austria1) vpi=8 vci=67 protocol=adslpppoa ;; Austria2) vpi=8 vci=48 protocol=adslpppoa ;; Austria3) vpi=8 vci=67 protocol=adslpppoallc ;; Austria4) vpi=8 vci=48 protocol=adslpppoallc ;; oldArcor) vpi=8 vci=35 protocol=adslpppoa ;; esac lcp_interval=30 # LCP interval lcp_failure=5 # LCP failure count debug='' usepeerdns='' active_filter='' if [ "$FRITZDSL_DEBUG" = "yes" ] then debug='debug' fi active_filter='' case ${DIALMODE}${FRITZDSL_HUP_TIMEOUT} in autonever) mode=persist ;; *) case "$FRITZDSL_FILTER" in yes) active_filter='precompiled-active-filter /etc/ppp/filter' esac mode=demand idle="idle $FRITZDSL_HUP_TIMEOUT" ;; esac if [ "$FRITZDSL_USEPEERDNS" = "yes" ] then usepeerdns='usepeerdns' fi echo "\"$FRITZDSL_USER\" * \"$FRITZDSL_PASS\" *" >> /etc/ppp/pap-secrets do_modprobe ppp_synctty if [ "$START_IMOND" = "yes" ] then defaultroute='defaultroute' # will be deleted after start of pppd. # pppd only fails if it is connected # or if it is trying to connect # in both cases the defaultroute was # existing and will exist after its restart. # There will be a risc that pppd may connect # if dialmode is manual and the route is not deleted # maybe a kill -1 will prevent this echo $DIALMODE >/var/run/pppoe.dialmode else defaultroute='defaultroute' echo auto >/var/run/pppoe.dialmode fi eval mtu="$FRITZDSL_MTU" eval mru="$FRITZDSL_MRU" : ${mtu:=1492} : ${mru:=1492} local=10.112.112.112 remote=10.112.112.113 dev=pppoe echo $local >/var/run/$dev.conf echo $remote >>/var/run/$dev.conf echo 'fcdsl' >/var/run/dsl.interface mkdir -p /etc/drdsl echo "controller $controller" > /etc/drdsl/adsl.conf echo "protocol $protocol" >> /etc/drdsl/adsl.conf echo "vpi $vpi" >> /etc/drdsl/adsl.conf echo "vci $vci" >> /etc/drdsl/adsl.conf mkdir -p /etc/ppp/peers cat < /etc/ppp/peers/circuit.$dev $usepeerdns noipdefault noauth $defaultroute hide-password nodetach local $debug mtu $mtu mru $mru noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp user "$FRITZDSL_USER" lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure holdoff 3 maxfail 0 $local:$remote ipcp-accept-remote ipcp-accept-local connect true ktune $mode $idle $active_filter sync ipparam fcdsl plugin capiplugin.so avmadsl EOF service-restart.sh 1 /usr/sbin/pppd call circuit.$dev /dev/null & sleep 1 # wait for pppd to come up and let it create the defaultroute ip route del default dev ppp0 # delete defaultroute kill -1 `cat /var/run/ppp0.pid` 2>/dev/null # ask pppd to hangup. Hopefully it also hangs up if it's in the process of dialing case $FRITZDSL_NF_MSS in MTU) tcpmss_opt=--clamp-mss-to-pmtu ;; *) tcpmss_opt="--set-mss $FRITZDSL_NF_MSS" ;; esac echo "/sbin/iptables -I FORWARD -o ppp0 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS $tcpmss_opt" >> /etc/rc.d/fwrules.pre.pppoe times="$FRITZDSL_TIMES" usepeerdns="$FRITZDSL_USEPEERDNS" name="$FRITZDSL_NAME" chargeint="$FRITZDSL_CHARGEINT" case ${FRITZDSL_HUP_TIMEOUT} in never) hup_timeout='0' ;; *) hup_timeout="$FRITZDSL_HUP_TIMEOUT" ;; esac . /etc/rc.d/dsl-circuit-common end_script fi