#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/rc340.circuits.pppoe_in_kernel - configuration of PPPoE # was file /etc/rc.d/pppoe # # Creation: 09.09.2000 fm # Last Update: $Id$ #---------------------------------------------------------------------------- case $OPT_PPPOE in yes) begin_script CIRCUITS_PPPOE "starting pppoe ..." : ${PPPOE_NF_MSS:=MTU} lcp_interval=30 # LCP interval lcp_failure=5 # LCP failure count pppoe_timeout=120 # should be 4 * lcp_interval ip link set $PPPOE_ETH mtu 1500 # set mtu to 1500 ip link set $PPPOE_ETH up debug='' usepeerdns='' active_filter='' idle= case "$PPPOE_DEBUG" in yes) debug='debug' ;; esac case ${DIALMODE}${PPPOE_HUP_TIMEOUT} in autonever) mode=persist ;; *) case "$PPPOE_FILTER" in yes) active_filter='precompiled-active-filter /etc/ppp/filter' esac mode=demand idle="idle $PPPOE_HUP_TIMEOUT" ;; esac case "$PPPOE_USEPEERDNS" in yes) usepeerdns='usepeerdns' ;; esac pppoe_dev=$PPPOE_ETH case $pppoe_dev in br*|dummy*) pppoe_dev="nic-$pppoe_dev" ;; esac echo "\"$PPPOE_USER\" * \"$PPPOE_PASS\" *" >> /etc/ppp/pap-secrets do_modprobe pppoe if [ "$START_IMOND" = "yes" ] then defaultroute='' # imond handles default route echo $DIALMODE >/var/run/pppoe.dialmode else defaultroute='defaultroute' echo auto >/var/run/pppoe.dialmode fi eval mtu="$PPPOE_MTU" eval mru="$PPPOE_MRU" : ${mtu:=1492} : ${mru:=1492} local=10.112.112.112 remote=10.112.112.113 case "$OPT_IPV6" in yes) ipv6enable='+ipv6' ipv6ifidentifier='ipv6 0::200:0:0:1,0::200:0:0:2' ;; *) ipv6enable='noipv6' ipv6ifidentifier='' ;; esac dev=pppoe echo $local >/var/run/$dev.conf echo $remote >>/var/run/$dev.conf mkdir -p /etc/ppp/peers cat < /etc/ppp/peers/circuit.$dev $usepeerdns plugin rp-pppoe.so noipdefault noauth $defaultroute hide-password nodetach local $debug mtu $mtu mru $mru noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp user "$PPPOE_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 EOF while true do pppd call circuit.$dev $pppoe_dev [ -f /etc/ppp/peers/circuit.$dev ] || exit 1 imond-stat "pppoe: restart" done & case $PPPOE_NF_MSS in MTU) tcpmss_opt=--clamp-mss-to-pmtu ;; *) tcpmss_opt="--set-mss $PPPOE_NF_MSS" ;; esac echo "/sbin/iptables -I FORWARD -o \`cat /var/run/pppoe-device\` -p tcp --tcp-flags SYN,RST SYN -j TCPMSS $tcpmss_opt" > /etc/rc.d/fwrules.pre.pppoe if [ -f /usr/local/sbin/pppoe-status ] then /usr/local/sbin/pppoe-status >/dev/tty3 & fi type=pppoe times="$PPPOE_TIMES" usepeerdns="$PPPOE_USEPEERDNS" name="$PPPOE_NAME" chargeint="$PPPOE_CHARGEINT" case ${PPPOE_HUP_TIMEOUT} in never) hup_timeout='0' ;; *) hup_timeout="$PPPOE_HUP_TIMEOUT" ;; esac . /etc/rc.d/dsl-circuit-common > /var/run/pppoe.HUP end_script ;; esac