• Revista PROGRAMAR: Já está disponível a edição #53 da revista programar. Faz já o download aqui!

daratshi

Configurar modem speedtouch no Mandriva Linux

3 mensagens neste tópico

Embora o deathseeker25  tenha já postado aqui a pagina onde fui buscar o toturial para instalar o speedtouch em linux tenho aqui uma cópia para o Mandriva Linux com uma tradução para portugues que possa ajudar quem tenha mais dificuldade.

Ora aqui vai:

The Linux Kernel Speedtouch Driver on Mandriva

Mandriva used to be called Mandrake but they changed their name, partly because of legal issues in France and partly because the merged with Connectiva. Between Mandrake and Mandriva, more than just the name changed.

The new kernel used by Mandrive loads the firmware itself without modem_run so the firmware needs to be handled differently. If you are using Mandrake 10.1 you'll need to follow the old Mandrake page.

Things you'll need

The firmware

If you have firmware you know works with your modem then stick with that. Otherwise, most people will use the firmware in this zipfile SpeedTouch330_firmware_3012.zip. When you've unzipped it you will get two files, KQD6_3.012 and ZZZL_3.012.

    * If you have an old green revision 0 or a purple revision 2 mode use the KQD6_3.012

    * If you have a silver revision 4 use the ZZZL_3.012

Sometimes the revision 0 modems work better with the mgmt.o firmware in this tarball. Use whatever works for you.

If you're not sure what revision your modem is, copy these commands into a terminal

cat /proc/bus/usb/devices | grep -B 1 THOMSON

cat /proc/bus/usb/devices | grep -B 1 ALCATEL

At the end of the first line it should say Rev= X.00

Where X is the version of the modem you have.

The Firmware Extractor

The firmware will need to be split into two parts with a binary called firmware-extractor so save a copy of that.

VPI/VCI Numbers

If you don't know the VPI/VCI numbers for your country/ISP then look in this  table or ask Google. While you're looking at that table, see if your ISP uses PPPoE or PPPoA.

br2684ctl

Not needed for PPPoA. The br2684ctl bridging utility is needed to be able to set up a PPPoE connection over ATM, so you'll only need it if your ISP uses PPPoE

Reboot into Mandriva

Gather together all the bits you'll need on a floppy disk, USB flash stick, partition of your hard drive or whatever works for you. Save a copy of this page at the same time then reboot into Mandriva, copy it all into your home folder and open this page in a browser.

PPP Plugins

pppd will need an extra plugin (shared library) to work over ATM. You can install these from your Mandriva CD's using the Control Centre

    * liblinux-atm

    * ppp-pppoatm

    * ppp-pppoe

Install The Firmware

Make the firmware-extractor executable then use it to split the firmware into two parts with these commands. Change $FIRMWARE for KQD6_3.012, ZZZL_3.012 or whatever the firmware you want to use is called. If you get an error that says "No such file or directory" you may have forgotten to copy the things into your home folder or you may have misspelt something

----------------------------------------

chmod +x firmware-extractor &&

./firmware-extractor FIRMWARE

----------------------------------------

That will create two files, speedtch-1.bin and speedtch-2.bin. You'll need to install them in /lib/hotplug/firmware but to write there, you need to become root with the su command

----------------------------------------

su

Password:

----------------------------------------

Now create /lib/hotplug/firmware and put the firmware in it with these commands (copy and paste)

----------------------------------------

install -d /lib/hotplug/firmware &&

install -m 400 speedtch-*.bin /lib/hotplug/firmware

Kernel Modules

----------------------------------------

To enable the kernel to perform certain functions you'll need to load some modules into the kernel. A simple way of doing this is to add them to the list of modules that get loaded when the kernel boots. As root, open /etc/modprobe.preload in a text editor.

kwrite /etc/modprobe.preload

Now add these (copy and paste)

ip_tables
iptable_filter
ip_conntrack
ip_conntrack_ftp
ipt_state
pppoatm
br2684

The last one on the list (br2684) is only needed by people using PPPoE so you can leave that one off if you're using PPPoA. Most of those modules are to get the firewall working.

Firewall

The default settings are for the Mandriva firewall to not allow you to access the internet at all. You can alter them with Mandriva's graphical point and click tools but I find them too complicated and difficult to understand. If you only have a single computer connected to the internet through your Speedtouch then this simple script will work fine. Use these commands to make a backup of your existing firewall bootscript and then open it with a text editor. As root, copy and paste this into a terminal

----------------------------------------

mv /etc/rc.d/init.d/shorewall /etc/rc.d/init.d/shorewall.old

kwrite /etc/rc.d/init.d/shorewall

----------------------------------------

Now copy and paste this.

#!/bin/bash


iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT


iptables -A INPUT -i lo -j ACCEPT


iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

If you want to run some sort of server like a peer to peer application you will need to add a rule to open some ports then configure the server to listen on those ports (Google for the details).

If you need your computer to act as a gateway for other computers on an ethernet local area network, have a look at the Xbox and PS2 Masquerading page and, of course, ask Google.

Secrets

You'll need to put your username and password in a file called either pap-secrets or chap-secrets so that ppp can look them up when it's negotiating with your ISP. If you don't know whether your ISP uses pap or chap authentication, put your details in both files.

Become root then open the files with a command in the terminal

----------------------------------------

kwrite /etc/ppp/chap-secrets

----------------------------------------

Or

----------------------------------------

kwrite /etc/ppp/pap-secrets

----------------------------------------

Then add one line like this

 'username@isp' * 'password' 

username@isp should be the username your ISP knows you by. Usually (but not always) it has an @isp bit at the end (it might be @dsl.fs, for example). Change password for the password you chose when you set up your internet account.

If your ISP uses PPPoE skip down to the PPPoE section

--------------------------//-----//-----------------------

PPPoA

To configure your ppp connection create a plain text file /etc/ppp/peers/speedtch

You'll need to be root to write there so use su to become root then open the text editor with a command

----------------------------------------

kwrite /etc/ppp/peers/speedtch

----------------------------------------

Now copy and paste this

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin pppoatm.so
0.00

Change username@isp for the username your ISP knows you by and change the 0.00 on the last line for the VP/VC values for your country and ISP. For example it might be 0.35

Tidying Up

When you reboot the kernel will detect the hardware and get hotplug to load the firmware. All that's left to do is to get pppd to call your ISP. This can be done with the command pppd call speedtch

To run that command when your computer boots, put it in a bootscript. As root open a text editor

----------------------------------------

kwrite /etc/rc.d/init.d/dial

----------------------------------------

Then copy and paste this and then save it

#!/bin/bash
count=0
while [ $count -lt 40 ]
do
  sync=$(dmesg | grep 'ADSL line is up')
  if [ ! -z "$sync" ]
  then
    pppd call speedtch
    exit 0
  fi
  sleep 1
  count=$((1+$count))
done
echo "The Speedtouch firmware didn't load"

Now, make it executable, make a symbolic link pointing at it from /etc/rc.d/rc5.d (so it gets run on boot), change the permissions on the scripts you've put in /etc/ppp so that they're not world readable. Open a root shell and copy this into it

chmod 744 /etc/rc.d/init.d/{dial,shorewall}
ln -s ../init.d/dial /etc/rc.d/rc5.d/S96dial
chmod 600 /etc/ppp/{*secrets,peers/speedtch}

When you reboot it should connect you to the web.

If not, check your firewall and check the details you put in /etc/ppp/*-secrets and /etc/ppp/peers/speedtch. If the firmware is loading OK the right LED will flash eight or nine times and then stay green. If ppp can't connect with your ISP try adding the option 'debug' to /etc/ppp/peers/speedtch, it will then be more verbose in the system log (/var/log/syslog).

--------------------------//-----//-----------------------

PPPoE

To configure your ppp connection create a plain text file /etc/ppp/peers/speedtch

You'll need to be root to write there so use su to become root then open the text editor with a command

----------------------------------------

kwrite /etc/ppp/peers/speedtch

----------------------------------------

Now copy and paste this

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
nas0

Change username@isp for the username your ISP knows you by. Often (but not always) it has an @isp bit at the end.

br2684ctl

As root install the br2684ctl binary in /usr/sbin

----------------------------------------

install -m 700 br2684ctl /usr/sbin

Tidying Up

----------------------------------------

When you reboot the kernel will detect the hardware and get hotplug to load the firmware. You'll need to use the br2684ctl to create a bridging connection and configure it with ifconfig then use ppp to call your ISP.

As root, open a text editor and use it to create a bootscript, /etc/rc.d/init.d/dial

----------------------------------------

kwrite /etc/rc.d/init.d/dial

----------------------------------------

Now copy and paste this into it but change VP.VC for the VPI/VCI numbers for your country/ISP.

#!/bin/bash
count=0
while [ $count -lt 40 ]
do
  sync=$(dmesg | grep 'ADSL line is up')
  if [ ! -z "$sync" ]
  then
    br2684ctl -b -c 0 -a VP.VC
    sleep 3
    ifconfig nas0 192.168.0.1 netmask 255.255.255.0
    sleep 10
    pppd call speedtch
    exit 0
  fi
  sleep 1
  count=$((1+$count))
done
echo "The Speedtouch firmware didn't load"

You just have some loose ends to fix now.

    * Change the permissions on that script so it can be executed

    * Make a symbolic link pointing at it from /etc/rc5.d

    * Change the permissions on the ppp configuration files so they're not world readable

----------------------------------------

chmod 744 /etc/init.d/{dial,shorewall}

ln -s ../init.d/dial /etc/rc.d/rc5.d/S96dial

chmod 600 /etc/ppp/{*secrets,peers/speedtch}

----------------------------------------

Reboot and you should be online.

If not, check your firewall and check the details you put in /etc/ppp/*-secrets and /etc/ppp/peers/speedtch. If the firmware is loading OK the right LED will flash eight or nine times and then stay green. If ppp can't connect with your ISP try adding the option 'debug' to /etc/ppp/peers/speedtch, it will then be more verbose in the system log (/var/log/syslog).

//

Se tiverem o cd do modem copiem o ficheiro alcaudsl.sys e coloquem-no na pasta (em que for avisado na instalação do modem(podem ter de criar a pasta por não existir))

//

0

Partilhar esta mensagem


Link para a mensagem
Partilhar noutros sites

Vou traduzir resumidamente para português para quem tem dificuldades em Inglês.

Fazer o download dos seguites ficheiros:

Firmware do modem

Extractor de firmware

br2684ctl

Copia todos os ficheiros para a tua pasta pessoal

Ver quas os números VPI/VCI a usar aqui

-----------------------------------------------------------

Depois disto feito deves de saber qual é a revisão do teu modem

em principio o roxo usa a 2 e o prateado usa a 4

Se não tiveres a certeza da revisão de firmware a usar usa estes comando para descobrires

cat /proc/bus/usb/devices | grep -B 1 THOMSON
cat /proc/bus/usb/devices | grep -B 1 ALCATEL

No fim deve de dizer a revisão ex Rev=x.00

Dependendo da revisão dentro do .rar que contem o firmware do modem deves de usar o ficheiro KQD6_3.012 (revisão 2) para o roxo e o ficheiro ZZZL_3.012 (revisão 4)

Guarda então todos os ficheiros necessarios e se for o caso faz reboot e entra no Mandriva.

Instala estes plugin atraves do centro de controlo, vai ser necesario o cd de instalação do Mandriva.

    * liblinux-atm
    * ppp-pppoatm
    * ppp-pppoe

Instala agora o firmware, deves de então pegar nos respectivos ficheiros dependendo da versão do modem o KQD6_3.012 ou então ZZZL_3.012 e  na linha de comandos executa estes códigos

chmod +x firmware-extractor &&
./firmware-extractor FIRMWARE

Deves de substituir FIRMWARE para o nome do ficheiro correcto, ou seja KQD6_3.012 ou então ZZZL_3.012

Agora tens de passar a root, para isso faz na linha de comandos

su
Password:

Agora instalas

install -d /lib/hotplug/firmware &&
install -m 400 speedtch-*.bin /lib/hotplug/firmware

Coloca este código na linha de comandos

kwrite /etc/modprobe.preload

vai abrir-te um ficheiro onde deves de adicionar estas linhas

ip_tables
iptable_filter
ip_conntrack
ip_conntrack_ftp
ipt_state
pppoatm
br2684

Fecha o documento.

Agora colocas então estes comandos um por um na linha de comandos

mv /etc/rc.d/init.d/shorewall /etc/rc.d/init.d/shorewall.old
kwrite /etc/rc.d/init.d/shorewall

No fim avi-te abrir um novo documento onde vais adicionar isto:

#!/bin/bash


iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT


iptables -A INPUT -i lo -j ACCEPT


iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

Fecha o documento.

Vais ter então de configurar o teu username de acesso a internet bem como password.

Abre este dois documentos (1 de cada vez):

kwrite /etc/ppp/chap-secrets
kwrite /etc/ppp/pap-secrets 

e adiciona-lhes uma linha como esta(substitui os dados pelos verdadeiros):

'username@isp' * 'password'

Fecha os documentos.

PPPOE

Agora na linha de fazes:

kwrite /etc/ppp/peers/speedtch

E no ficheiro que abrir adiciona, altera o teu username@isp para o real username:

ow copy and paste this
noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
nas0

Executa agora este comando:

 install -m 700 br2684ctl /usr/sbin 

Reenicia

Agora executa isto na linha de comandos:

kwrite /etc/rc.d/init.d/dial

No documento que abrir copia para lá isto, mas altera os valores VP.VP para os reais que podes consultar na tabela colocada no inicio do tópico.

#!/bin/bash
count=0
while [ $count -lt 40 ]
do
  sync=$(dmesg | grep 'ADSL line is up')
  if [ ! -z "$sync" ]
  then
    br2684ctl -b -c 0 -a VP.VC
    sleep 3
    ifconfig nas0 192.168.0.1 netmask 255.255.255.0
    sleep 10
    pppd call speedtch
    exit 0
  fi
  sleep 1
  count=$((1+$count))
done
echo "The Speedtouch firmware didn't load"

Agora executa estes comandos:

chmod 744 /etc/init.d/{dial,shorewall}
ln -s ../init.d/dial /etc/rc.d/rc5.d/S96dial
chmod 600 /etc/ppp/{*secrets,peers/speedtch}

//

Se tiverem o cd do modem copiem o ficheiro alcaudsl.sys e coloquem-no na pasta (em que for avisado na instalação do modem(podem ter de criar a pasta por não existir))

//

Reenicia e deves de tens internet :D

Traduzi apenas o necessario para que em poucos passos consigas resolver o problema.

0

Partilhar esta mensagem


Link para a mensagem
Partilhar noutros sites

Crie uma conta ou ligue-se para comentar

Só membros podem comentar

Criar nova conta

Registe para ter uma conta na nossa comunidade. É fácil!


Registar nova conta

Entra

Já tem conta? Inicie sessão aqui.


Entrar Agora