#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/rc340.circuits.fcdsl - configuration of Fritz!Card DSL # # Creation: 28.05.2003 ow # Last Update: $Id$ #---------------------------------------------------------------------------- if [ "$OPT_FRITZDSL" = "yes" ] then begin_script CIRCUITS_FCDSL "starting fcdsl ..." : ${FRITZDSL_NF_MSS:=MTU} # set by etc/rc.d/rc220.i4l if AVM CAPI is used if [ -f /var/run/avm_capi ] then controller=2 else controller=1 # we don't know if CAPI has already been loaded for a non-AVM CAPI # adapter, so we have to do it now (init_capi will not do anything # if CAPI layer has already been initialized) init_capi fi case "$FRITZDSL_TYPE" in fcdslsl) do_modprobe fcdslsl /sbin/avmcapictrl load /lib/firmware/isdn/fdssbase.bin "$controller" ;; fcdslslusb) do_modprobe fcdslslusb /sbin/avmcapictrl load /lib/firmware/isdn/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 case ${DIALMODE}${FRITZDSL_HUP_TIMEOUT} in autonever) mode=persist ;; *) active_filter=$(ppp_filter_get) [ -n "$active_filter" ] && active_filter="active-filter \"$active_filter\"" 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 localll=::200:0:0:1 remotell=::200:0:0:2 dev=pppoe echo $local >/var/run/$dev.conf echo $remote >>/var/run/$dev.conf case "$OPT_IPV6" in yes) ipv6enable='+ipv6' ipv6ifidentifier="ipv6 $localll,$remotell" echo $localll >/var/run/$dev.conf.ipv6 echo $remotell >>/var/run/$dev.conf.ipv6 ;; *) ipv6enable='noipv6' ipv6ifidentifier='' ;; esac 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 $ipv6enable $ipv6ifidentifier 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