#!/bin/sh # # pppoed This shell script takes care of starting and stopping # the pppoed. # ## # -Rms ## # # chkconfig: - 07 93 # description: pppoed # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Ethernet Device on which the PPPoE modem is connected DEVICE=eth1 # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # See how we were called. case "$1" in start) ret=0 echo -n "Starting pppoed: " /sbin/modprobe pppoe /sbin/modprobe ipt_TCPMSS /sbin/modprobe ipt_tcpmss /sbin/iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN \ -j TCPMSS --clamp-mss-to-pmtu # Device needs to be up before pppd is called /sbin/ifconfig $DEVICE 0.0.0.0 mtu 1450 up daemon /usr/sbin/pppd file /etc/ppp/options.PPPoE $DEVICE & ret=$? # Since PPPoE takes a while to start we drop it in the background # and sleep here. sleep 8 touch /var/lock/subsys/pppoed if [ "$BOOTUP" = "color" ]; then [ "${ret}" -eq 0 ] && echo_success || echo_failure fi echo exit ${ret} ;; stop) ret=0 # Stop daemons. echo -n "Shutting down pppoed: " killproc pppd rm -f /var/lock/subsys/pppoed /sbin/iptables -D FORWARD -p tcp --tcp-flags SYN,RST SYN \ -j TCPMSS --clamp-mss-to-pmtu /sbin/rmmod ipt_TCPMSS /sbin/rmmod ipt_tcpmss /sbin/rmmod pppoe /sbin/rmmod pppox /sbin/ifconfig $DEVICE down if [ "$BOOTUP" = "color" ]; then [ "${ret}" -eq 0 ] && echo_success || echo_failure fi echo exit ${ret} ;; status) status pppd ;; restart) $0 stop $0 start exit $? ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0