Speedtouch 330 PPPoE

Şuraya atla: kullan, ara


Bu makalenin geliştirilmeye ihtiyacı vardır. Eğer yardım edebilirseniz lütfen OpenSUSE Style Guide içerisinde yapın.

Eger yapacak birşeyler arıyorsanız articles that need expanding

Icon-Caution.png
The procedure in this article was written and tested with version SUSE 10.0
Whilst there is no guarantee, it should be applicable to later versions.
If you find this to be incorrect, please help to update this article.


Getting the firmware

Different versions of the Speedtouch use different firmware. If you already have firmware you know works with your modem then stick with that. If you're not sure what firmware to use, first find out what revision your modem is. Use the command

grep -B 1 "THOMSON
ALCATEL" /proc/bus/usb/devices

At the end of the first line it should say Rev= X.00 where X is the version of the modem you have.

If you have an old green revision 0 or a revision 2 modem (they're usually purple/burgundy) the KQD6_3.012 file from this zip file is the one to use. That zip also holds the ZZZL_3.012 firmware for the (usually silver) revision 4 modem.

The old green rev 0's can be temperamental, if it doesn't like the KQD6_3.012, try the mgmt.o firmware from this tarball

To prepare the firmware, so the kernel can load it, you'll need to split it in two with a precompiled copy of the firmware extractor.

You will need a copy of the br2684ctl bridging utility to be able to do PPPoE over ATM, so save a copy of that.

In next step You need to login as root so I suggest to save downloaded files in /root directory.

Preparing system

To configure things outside your home folder you need to have root privileges. Root can do a lot of damage so be careful or you may need to spin the CD and reinstall. But some things have got to be done as root, so logout of your own account and log in as root

Install the firmware

If you've got a revision 0 or revision 2 modem unzip the KQD6_3.012 and use the firmware-extractor to split it into two parts, speedtch-1.bin and speedtch-2.bin :

unzip SpeedTouch330_firmware_3012.zip
chmod +x firmware-extractor
./firmware-extractor KQD6_3.012

For a revision 4 modem it's basically the same but with different firmware

unzip SpeedTouch330_firmware_3012.zip 
chmod +x firmware-extractor 
./firmware-extractor ZZZL_3.012 

If you've got some other firmware file you want to try, split it in two with the firmware-extractor in the same way

chmod +x firmware-extractor 
./firmware-extractor /path/to/your/firmware 

Now you've prepared the firmware, copy it into hotplugs firmware folder, /lib/firmware

cp speedtch* /lib/firmware

Install bridging utility

PPPoE over ATM needs this :

install -m 744 br2684ctl /usr/sbin

Configure pppd

Create file /etc/ppp/peers/speedtch

touch /etc/ppp/peers/speedtch

Edit with your preferred editor. Copy and paste this, change username@isp and password.

noipdefault
defaultroute
user 'USERNAME@ISP'
password 'PASSWD'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
mtu 1492
mru 1492
###Uncomment if u wish permanent connection
#persist
nas0
### You may need to uncomment these
### options to connect with some ISP's.
### They disable compression.
#noaccomp
#nobsdcomp
#nodeflate
#nopcomp
#noccp
#novjccomp
### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log
#debug
### For more details (and more options)
### read man pppd

Hmmm file with plain password , so better :

chmod 600 /etc/ppp/peers/speedtch

The init script

Create file /etc/init.d/speedtch

touch /etc/init.d/speedtch

Edit with your preferred editor. Copy and paste this

#! /bin/sh 
# Author: Kiss Ferenc Lorant
# Please send feedback to kfl62@yahoo.com
#
# /etc/init.d/speedtch
#   and its symbolic link
# /usr/sbin/rcspeedtch
#
#    This program is free software; you can redistribute it and/or modify 
#    it under the terms of the GNU General Public License as published by 
#    the Free Software Foundation; either version 2 of the License, or 
#    (at your option) any later version. 
# 
#    This program is distributed in the hope that it will be useful, 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
#    GNU General Public License for more details. 
# 
#    You should have received a copy of the GNU General Public License 
#    along with this program; if not, write to the Free Software 
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Template system startup script for some example service/daemon speedtch
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
# 
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux (UL) based Linux distributions. If you want to base your 
# script on this template and ensure that it works on non UL based LSB 
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
#
### BEGIN INIT INFO
# Provides:          speedtch
# Required-Start:$ALL
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Speedtch daemon providing pppoe for Speedtouch USB modem
# Description:       Speedtch daemon providing pppoe for Speedtouch USB modem
# continued on second line by '#<TAB>'
# should contain enough info for the runlevel editor
# to give admin some idea what this service does and
# what it's needed for ...
# (The Short-Description should already be a good hint.)
### END INIT INFO
# 
# Check for missing firmware or files (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
SPEEDTCH_FRM1=/lib/firmware/speedtch-1.bin
test -e $SPEEDTCH_FRM1 || { echo "Firmware $SPEEDTCH_FRM1 not installed"; 
 if [ "$1" = "stop" ]; then exit 0;
 else exit 5; fi; }
SPEEDTCH_FRM2=/lib/firmware/speedtch-2.bin
test -e $SPEEDTCH_FRM2 || { echo "Firmware $SPEEDTCH_FRM2 not installed"; 
 if [ "$1" = "stop" ]; then exit 0;
 else exit 5; fi; }
SPEEDTCH_PEER=/etc/ppp/peers/speedtch
test -r $SPEEDTCH_PEER || { echo "Config file $SPEEDTCH_PEER  not existing"; 
 if [ "$1" = "stop" ]; then exit 0;
 else exit 5; fi; }
# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     be verbose in local rc status and clear it afterwards
#      rc_status -v -r  ditto and clear both the local and overall rc status
#      rc_status -s     display "skipped" and exit with status 3
#      rc_status -u     display "unused" and exit with status 3
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num>
#      rc_reset         clear both the local and overall rc status
#      rc_exit          exit appropriate to overall rc status
#      rc_active        checks whether a service is activated by symlinks
. /etc/rc.status
# Reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0   - success
# 1       - generic or unspecified error
# 2       - invalid or excess argument(s)
# 3       - unimplemented feature (e.g. "reload")
# 4       - user had insufficient privileges
# 5       - program is not installed
# 6       - program is not configured
# 7       - program is not running
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
#Checking ADSL status if firmware is loaded
firmw_status() {
count=0
while [ $count -lt 4 ]
do
 sync=$(dmesg | grep 'ADSL line is up')
 if [ ! -z "$sync" ]
 then
   if  [ $count -eq 0 ]
   then
     echo -n "Checking ADSL status"
   else
     echo -n "Finally ADSL line is up :)"
   fi
   rc_reset
   rc_status -v
   count=5
 else
 rc_failed
 if [ $count -eq 0 ]
 then
   echo "Checking ADSL status"
   sleep 20
   echo "ADSL line is down . (Retry in 20 sec )"
 else
   sleep 20
   echo "Sorry ADSL line still down"
 fi
 count=$((1+$count))
 fi
done
if [ $count -eq 4 ]
then
  echo -n "The Speedtouch firmware didn't load" 
  rc_failed
  rc_status -v
  exit 7
fi
}
# Check for existence of needed config file and read it
# SPEEDTCH_CONFIG=/etc/sysconfig/speedtch
# test -r $speedtch_CONFIG || { echo "$speedtch_CONFIG not existing";
# 	if [ "$1" = "stop" ]; then exit 0;
# 	else exit 6; fi; }
# 
# # Read config	
# . $speedtch_CONFIG
case "$1" in
   start)
       /sbin/modprobe pppoatm
       /sbin/modprobe br2684 
       firmw_status
       echo -n "Starting speedtch ( step 1 interface nas0 )"
       # Start daemon with startproc(8). If this fails
       # the return value is set appropriately by startproc.
       /sbin/startproc /usr/sbin/br2684ctl -b -c 0 -a VPI.VCI 2>/dev/null
       /sbin/ifconfig nas0 192.168.0.13 netmask 255.255.255.0
       # Remember status and be verbose
       rc_status -v
       echo -n "Starting speedtch ( step 2 interface ppp0 )"
       /sbin/startproc /usr/sbin/pppd call speedtch 1>/dev/null 2>/dev/null
       /usr/sbin/iptables -t nat -A POSTROUTING -j MASQUERADE -o ppp0
       # Remember status and be verbose
       rc_status -v
       ;;
    stop)
       echo -n "Shutting down speedtch ( step 1 interface ppp0 )"
	## Stop daemon with killproc(8) and if this fails
       ## killproc sets the return value according to LSB.
       /sbin/killproc -TERM /usr/sbin/pppd
       # Remember status and be verbose
       rc_status -v
       echo -n "Shutting down speedtch ( step 2 interface nas0 )"
       /sbin/killproc -TERM /usr/sbin/br2684ctl
       /usr/sbin/iptables -t nat -F
       # Remember status and be verbose
       rc_status -v
	;;
    restart)
       ## Stop the service and regardless of whether it was
       ## running or not, start it again.
       $0 stop
       $0 start
       # Remember status and be quiet
       rc_status
       ;;
    status)
       echo -n "Checking for interface nas0 "
       ## Check status with checkproc(8), if process is running
       ## checkproc will return with exit status 0.
       # Return value is slightly different for the status command:
       # 0 - service up and running
       # 1 - service dead, but /var/run/  pid  file exists
       # 2 - service dead, but /var/lock/ lock file exists
       # 3 - service not running (unused)
       # 4 - service status unknown :-(
       # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
       # NOTE: checkproc returns LSB compliant status values.
       /sbin/checkproc /usr/sbin/br2684ctl
       rc_status -v
       echo "Details :"
       /sbin/ifconfig nas0
       # NOTE: rc_status knows that we called this init script with
       # "status" option and adapts its messages accordingly.
       echo -n "Checking for interface ppp0 "
       ## Check status with checkproc(8), if process is running
       ## checkproc will return with exit status 0.
       # Return value is slightly different for the status command:
       # 0 - service up and running
       # 1 - service dead, but /var/run/  pid  file exists
       # 2 - service dead, but /var/lock/ lock file exists
       # 3 - service not running (unused)
       # 4 - service status unknown :-(
       # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
       # NOTE: checkproc returns LSB compliant status values.
       /sbin/checkproc /usr/sbin/pppd
       rc_status -v
       echo "Details :"
       /sbin/ifconfig ppp0
       # NOTE: rc_status knows that we called this init script with
       # "status" option and adapts its messages accordingly.
       ;;
   *)
       echo "Usage: $0 {start|stop|restart|status}"
       exit 1
       ;;
esac
rc_exit

Change VPI.VCI for the VPI/VCI numbers for your country/ISP. For example in Romania it would be 0.35

Change or Comment lines (158,171 bold in this listing)regarding masquerading.

Now change the permissions on that script so it can be executed and use the insserv command so that it gets run automagically during the boot process.

chmod 744 /etc/init.d/speedtch
insserv speedtch

Create a symbolic link

cp -s /etc/init.d/speedtch /usr/sbin/rcspeedtch

Reboot and you should be online.

You may control connection with rcspeedtch |start|stop|restart|status|

Notes

  • Also thanks for init script skeleton :
#
# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Kurt Garloff
# Please send feedback to http://www.suse.de/feedback/
#