LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 873|回复: 2

mandrake offical下使用阿尔卡特usb adsl的方法

[复制链接]
发表于 2004-7-20 10:52:00 | 显示全部楼层 |阅读模式
我是按照下面找到的一篇文章做的:
1、上这儿下载:http://prdownloads.sourceforge.n ... 1.0.tar.gz?download
speedbundle-1.0.tar.gz这个文件;
   上这儿下载我以前的那个软件包里有mgmt.o文件,地址:http://www.ywzx.com.cn/bbs/images/u...2/01/084026.zip(严重注意,只需要mgmt.o文件,其它的软件包不要安装,不要去安装mdk自带的speedtouch usb adsl驱动)

2、拷贝到root目录下,运行tar zxf speedbundle-1.0.tar.gz
   拷贝mgmt.o文件到/root/speedbundle-1.0/firmware目录下,并改名为firmware.bin
3、进入/root/speedbundle-1.0目录,修改几个文件
   a.修改/root/speedbundle-1.0目录下的Makefile文件,内容改成如下:
all: build

configure: configure-stamp
configure-stamp:
        ./configure

build: configure-stamp build-stamp
build-stamp:
#        cd kernel_module && $(MAKE)
        cd linux-atm && $(MAKE)
        cd ppp && $(MAKE) C_INCLUDE_PATH=../../../linux-atm/src/include LIBRARY_PATH=../../../linux-atm/src/lib/.libs
        cd firmware && $(MAKE)
#        cd firmware_loader && $(MAKE)
        cd hotplug_scripts && $(MAKE)
        cd ppp_scripts && $(MAKE)
        touch build-stamp

clean:
        rm -f build-stamp configure-stamp
        cd firmware && $(MAKE) clean
#        cd firmware_loader && $(MAKE) clean
        cd hotplug_scripts && $(MAKE) clean
#        cd kernel_module && $(MAKE) clean
        cd linux-atm && $(MAKE) clean
        cd ppp && $(MAKE) clean
        cd ppp_scripts && $(MAKE) clean

install: build
#        cd kernel_module && $(MAKE) install
        cd firmware && $(MAKE) install
#        cd firmware_loader && $(MAKE) modem_run
        cd hotplug_scripts && $(MAKE) install
        cd linux-atm && $(MAKE) install
        cd ppp && $(MAKE) install
        cd ppp_scripts && $(MAKE) install
    b、修改/root/speedbundle-1.0目录下的configure文件,内容如下:
#!/bin/bash
#cd kernel_module && ./configure && cd .. && \
cd hotplug_scripts && ./configure && cd .. && \
cd ppp_scripts && ./configure && cd .. && \
cd firmware && ./configure && cd .. && \
#cd firmware_loader && ./configure --prefix=/usr && cd .. && \
cd linux-atm && ./configure --prefix=/usr && cd .. && \
cd ppp && ./configure && cd .. && \
touch configure-stamp
    c、把/root/speedbundle-1.0/ppp_scripts/speedtch-pppoatm文件改名为speedtch,并进行修改
# To connect to using this configuration file, do
#         pppd call speedtch

lcp-echo-interval 10
lcp-echo-failure 3
noipdefault
defaultroute
user "username"(引号内填你的上网帐号)
noauth
noaccomp
nopcomp
noccp
novj
holdoff 4
persist
maxfail 25
updetach
usepeerdns
plugin pppoatm.so
0.00           (第一个0是真vpi,后面两个00填vci,我的是8.35)

    d、修改/root/speedbundle-1.0/ppp_scripts/目录下的chap-secrets和pap-secrets这两文件的内容,改成你自己的帐号和密码,我的是这样的
# Secrets for authentication using CHAP
# client        server        secret                IP addresses
zswei@163.gd        *        wei7269
4、进行安装:
   rpm -e --nodeps ppp
   make
   make install
重启后就自动连上网了,可以用ifconfig试一下


SpeedTouch USB ADSL  modem HOWTO for Mandrake 10.0







Mandrake Linux releases contain since long the drivers to run the SpeedTouch USB ADSL modem. Yet I never succeeded in getting those drivers to operate. I tried hard, both sticking to the data sheets and experimenting exotic configurations. Maybe that's due to some particularities of the ADSL providers in my country, Belgium (I tried out two three of them). Anyway the solution has always be to install vanilla SpeedTouch drivers found on the Web, allways the userspace drivers initiated by Benoît Papillaut. Mandrake 10 is special in that no existing driver package operates. I finally got it through by making a mixture of the Mandrake 10 drivers and the Speedbundle 1.0 drivers package. That's what this HowTo describes.

The reference sites for the Speedbundle package are http://www.linux-usb.org/SpeedTouch and http://sourceforge.net/project/showfiles.php?group_id=3581 . It is maintained by Duncan Sands.

Warning: I'm using PPPoA. The Speedbundle 1.0 provides PPPoE too but I could not get it working.

The Speedbundle 1.0 package works properly with the standard manta-shaped SpeedTouch USB ADSL modem. It should work with the other kinds of SpeedTouch modems provided you use the apropriate microcode. This page seems to propose the microcodes (firmware) for all SpeedTouch and Smoothwall modems: http://www.hystedjp.pwp.blueyonder.co.uk/ and this page proposes some data too: http://linux-usb.sourceforge.net/SpeedTouch/download/index.html.

Please note there has to be a carriage return at the end of the last line of each configuration file. In other words: the text of each file must end with an empty blank line.



Be root (superuser)

The procedures described below assumes you log in as root. That's a problem on Mandrake releases since everything was done to prevent the user doing so. Basically there are three solutions to circumvent this:

Only use the consoles (type Ctrl-Alt-F1 (or F2, F3... F6)) and login as root. Type Ctrl-Alt-F7 to get back to the X11 windowing system. To edit files in consoles, for example use the  mcedit  command, like this:

mcedit path_to_the_file


While being logged in as simple user in KDE, Launch a terminal window and become root by first issuing the  su  command (then type the root password) then by going towards the root directory with the  cd /root  command. (You can get a Konqueror window with root privileges by then issuing the konqueror command.)

su
cd /root

konqueror &



Change the Display Manager. Use the MandrakeLinux Control Center ("Configure your computer") and change the Display Manager from MdkKDM to KDM. Indeed KDM allows to login in as root. That's halfway to get it since once you will be logged in as root and KDE started, you will find out just everything was made to make things hard: near empty taskbar, no icons on the Desktop, no keyboard autorepeat... You need to launch the KDE configuration tool ("Configure your desktop") and tune everything back to a civilized situation.



Installing Mandrake 10

I did no network configurations. I simply let things like they were. The only thing I tuned is I asked for the "Internet/Network client" packages to be installed.

Configuring the firewall to block out everything yields no problem and is a good thing for your security.



Get the Speedbundle package

You have to get the speedbundle-1.0.tar.gz file. You should be able to download it by going to this page: http://sourceforge.net/project/s ... p;release_id=172024 . If you don't succeed with this link go to the Linux-USB SpeedTouch site and follow the links: http://www.linux-usb.org/SpeedTouch

Put the speedbundle-1.0.tar.gz file in your /root directory.

Extract it, using any suitable method (right-clic on it with the mouse in Konqueror) or simply by typing this in a terminal window (being root and in the /root directory):


tar xzf speedbundle-1.0.tar.gz



That creates the directory /root/speedbundle-1.0



Get the SpeedTouch USB firmware

Go to one of these pages and download the appropriate microcode for your modem:


http://www.hystedjp.pwp.blueyonder.co.uk/
http://www.linux-usb.org/SpeedTouch/download/index.html



Or use the Microcode present on your modem install CD. I used the mgmt.o microcode file from years ago and got a perfect result. Any file should do the job: KQD6P2.eni, alcaudsl.sys... Try to get the file that suits your modem. If you get problems retry using another microcode file.

Whatever file you download or get, rename it so it gets the name firmware.bin

Put that firmware.bin file inside the /root/speedbundle-1.0/firmware/ directory.

Later on, if you get problems running the connection, you can try to change the firmware file. You don't have to start the install procedure over again. Just put the trial firmware file (renamed firmware.bin) inside the /usr/lib/speedtouch folder and unplug then re-plug the modem or restart the computer.



Creating the speedtch file

Inside the directory /root/speedbundle-1.0/ppp_scripts/ you will find a file named speedtch-pppoatm . Rename (or copy) it into speedtch.

Open that /root/speedbundle-1.0/ppp_scripts/speedtch file and change inside it the two lines marked red below. The "username" should be replaced by your login. For example "tartemp1@PLANET" or "fa789123@SKYNET". The 0.00 should be replaced by the vpi.vci numbers suitable for your country or provider. For Belgium that's 8.35 . Below is a table with the codes for other countries or providers. Maybe best rely on the data provided by your DSL provider or phone the helpdesk. See the page http://www.linux-usb.org/SpeedTouch/faq/index.html#q12 for even more countries. (Remind the configuration files must end with a carriage return, that is an empty blank line.) (Tip: add the "persist" option in the configuration file. That way the modem should dial again automatically when the connection stops. This is useful when you have a Linux box you can switch on for months and an ADSL provider that stops the connection every 24 hours.)



# To connect to using this configuration file, do
#     pppd call speedtch

lcp-echo-interval 10
lcp-echo-failure 3
noipdefault
defaultroute
user "yourlogin@YOURPROVIDER"
noauth
noaccomp
nopcomp
noccp
novj
holdoff 4
persist
maxfail 25
updetach
usepeerdns
persist
plugin pppoatm.so
yourvpi.yourvci




Code Table
VPI
VCI

France, Belgium, Italy, Spain Retevision, Sweden, USA 8
35

Spain Telefonica
8
32

Netherlands (Holland)
8
48

United Kingdom
0
38

Portugal, Poland
0
35

Finland
0
100

Germany, Hongary
1
32




Changing the chap-secrets file

You must change the /root/speedbundle-1.0/ppp_scripts/chap-secrets file to make it contain your login and password. Like this:



# Secrets for authentication using CHAP
# client    server    secret        IP addresses
"tartemp1@PLANET"    *    "fefgr78kt"   *




Changing the pap-secrets file

You must do the same for the /root/speedbundle-1.0/ppp_scripts/pap-secrets file. Fill in your login and password. (You may wonder why you have to fill in your login and password in two different files. That's because your ADSL provider may be using either the CHAP or PAP protocol to authenticate. By filling in both files you avoid to puzzle on what authentication protocol is used and you won't get into problems should your ADSL provider change.)



# Secrets for authentication using PAP
# client    server    secret        IP addresses
"tartemp1@PLANET"    *    "fefgr78kt"   *




Remove the Speedbundle installs you don't need

The Speedbundle 1.0 package is meant to install a "kernel module" on Linux systems with an old kernel. You don't need that when using Mandrake 10 as its kernel already contains the module. Besides building this module can yield problems and need complicated maneuvers like installing the kernel sources and starting a kernel configure procedure. So you *must* remove it from the Speedbundle make procedure.

Also the firmware loader install (modem_run command) (firmware = modem microcode) should be avoided since the Mandrake 10 allready contains a modem-run command. Besides the modem_run command from the Speedbundle simply won't operate. The ADSL LED of the modem will stay orange and no connection will succeed.

To do so open the file /root/speedbundle-1.0/Makefile and comment out with a # sign (or erase) the following lines:



all: build

configure: configure-stamp
configure-stamp:
    ./configure

build: configure-stamp build-stamp
build-stamp:
    # cd kernel_module && $(MAKE)
    cd linux-atm && $(MAKE)
    cd ppp && $(MAKE) C_INCLUDE_PATH=../../../linux-atm/src/include LIBRARY_PATH=../../../linux-atm/src/lib/.libs
    cd firmware && $(MAKE)
    # cd firmware_loader && $(MAKE)
    cd hotplug_scripts && $(MAKE)
    cd ppp_scripts && $(MAKE)
    touch build-stamp

clean:
    rm -f build-stamp configure-stamp
    cd firmware && $(MAKE) clean
    # cd firmware_loader && $(MAKE) clean
    cd hotplug_scripts && $(MAKE) clean
    # cd kernel_module && $(MAKE) clean
    cd linux-atm && $(MAKE) clean
    cd ppp && $(MAKE) clean
    cd ppp_scripts && $(MAKE) clean

install: build
    # cd kernel_module && $(MAKE) install
    cd firmware && $(MAKE) install
    # cd firmware_loader && $(MAKE) modem_run
    cd hotplug_scripts && $(MAKE) install
    cd linux-atm && $(MAKE) install
    cd ppp && $(MAKE) install
    cd ppp_scripts && $(MAKE) install



Open the /root/speedbundle-1.0/configure file and comment out with a # sign (or erase) the following lines:



#!/bin/bash
# cd kernel_module && ./configure && cd .. && \
cd hotplug_scripts && ./configure && cd .. && \
cd ppp_scripts && ./configure && cd .. && \
cd firmware && ./configure && cd .. && \
# cd firmware_loader && ./configure --prefix=/usr && cd .. && \
cd linux-atm && ./configure --prefix=/usr && cd .. && \
cd ppp && ./configure && cd .. && \
touch configure-stamp




Remove the ppp package

The Speedbundle package contains an upgraded pppd daemon. So before installing you must remove the ppp package from your system. Do that with the following command in a console or terminal window:


rpm -e --nodeps ppp




Building & installing the Speedbundle package

In a terminal window, go inside the /root/speedbundle-1.0/ directory and type the build and install commands:


cd /root/speedbundle-1.0/
make
make install




Trying out if the modem is recognized

Simply plug in the modem in a USB port of your computer (or unplug it, if it was plugged, then plug it back in). Best it should also be connected to the phone line, for the purpose of next item. After a few seconds the modem LEDs should start blinking for a short while. This shows the modem has been seen and the firmware is being uploaded to the modem's memory. (This will happen automatically whenever you plug in your modem or switch on your computer and start your Linux box.) (The script in charge of this automated device activation is /etc/hotplug/usb/speedtch .)

If nothing happens, maybe there is a problem with your USB connectors. Type this command to chech if the modem is seen by the system:


lsusb



That yields following output on my machine, showing both my Epson printer and the modem are connected and get basic system recognition:



Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 003: ID 06b9:4061 Alcatel Telecom Speed Touch ISDN or ADSL Modem
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
Bus 001 Device 001: ID 0000:0000




The End

There you are. Now you can browse on the Web, download files, send and receive mail... Well I wish you can.

Whenever you start your computer the ADSL Internet connection should start automatically. Also when you plug in the modem.

The connection is available for every user of the computer.



Changing the account data

Suppose you change your password, get another login, change ADSL provider or simply want to check the configurations are correct. What then? Do you have to start again the whole install procedure? No: simply go into these files and check or change their content:


/etc/ppp/chap-secrets
/etc/ppp/pap-secrets
/etc/ppp/peers/speedtch




How can I know the connection is on?

If you can browse the Web using Mozilla or Konqueror, obviously the connection is on. Be careful no to browse pages which are in the cache memory of the browser. Make a random Google search or so in order to verify your computer really has a dialog with the Web.

A more technical way to check the connection is to make a ping. With this command. Maybe choose another address than Google not to load that given server:


ping -c 3 www.google.com



If the connection is on then the output should be something like this:



PING www.google.akadns.net (66.102.11.99) 56(84) bytes of data.
64 bytes from 66.102.11.99: icmp_seq=0 ttl=53 time=45.5 ms
64 bytes from 66.102.11.99: icmp_seq=1 ttl=53 time=47.1 ms
64 bytes from 66.102.11.99: icmp_seq=2 ttl=53 time=52.4 ms

--- www.google.akadns.net ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2020ms
rtt min/avg/max/mdev = 45.500/48.388/52.479/2.984 ms, pipe 2



A special case is the connection is on yet there is a DNS problem. So your system cannot translate the www.google.com address in it's IP address 66.102.11.99 . Simply type the ping command using that IP address: (Please note this address could have changed by the time you try this out. Maybe phone a friend to ask him for any IP address currently active on the Web.)


ping -c 3 66.102.11.99



Another way round but it proves nothing is to check if the pppd daemon is present:


ps -A



You should see the pppd daemon somewhere in the list. (You can also use any job control software.) If you want a shorter output for the above command just type this instead. Either you see an output line listing the pppd daemon or you see nothing then it is not running currently:


ps -A | grep ppp



Yet another way is to type the ifconfig command and check if there is an activated ppp0 network interface:


ifconfig



Below is what it yields currently on my computer. Obviously there is an active ppp0 network interface:



eth0      Link encap:Ethernet  HWaddr 00:0C:6E:1D:BE:2B
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:3 Base address:0xd000

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:268 errors:0 dropped:0 overruns:0 frame:0
          TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:24178 (23.6 Kb)  TX bytes:24178 (23.6 Kb)

ppp0      Link encapoint-to-Point Protocol
          inet addr:75.12.125.199  P-t-P:75.12.124.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:34828 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21739 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:50110871 (47.7 Mb)  TX bytes:1262955 (1.2 Mb)




How can I stop the connection?

Just kill the pppd daemon:


killall pppd



(Clue: if you aren't root and wants to be, simply type the  su  command then type the root password when asked.)



How can I start the connection again?

Best is to re-start the pppd daemon this way:


pppd call speedtch



The content of this text may suggest you other ways.



Can I have more ADSL accounts?

The "speedtch" in the pppd call command above means the pppd daemon should use the /etc/ppp/peers/speedtch file. You can define as many such files you want inside the /etc/ppp/peers/ directory. Simply make copies of the initial speedtch file and tune them to your needs. You can also add lines inside the /etc/ppp/chap-secrets and /etc/ppp/pap-secrets files to register more logins and passwords. Suppose you added a second line to the /etc/ppp/chap-secrets and /etc/ppp/pap-secrets files for another account and created a file speedtch_other_provider inside the /etc/ppp/peers/ directory. Then you can start that other ADSL account by first killing the pppd daemon then restarting it:


killall pppd
pppd call speedtch_other_provider



If you want the computer to start that other account by default, change the  /etc/hotplug/usb/speedtch file accordingly or change the  /etc/hotplug/usb/speedtch file accordingly:



#!/bin/bash

case $ACTION in

add)
    if /usr/sbin/modem_run -k -f /usr/lib/speedtouch/firmware.bin ; then
        sleep 5
        /usr/sbin/pppd call speedtch_other_provider
    fi
    ;;

esac



If you simply don't want the connection to start when you switch the computer on or when you plug in the modem, comment that line out:



# killall pppd
# pppd call speedtch_other_provider

If you want the computer to start that other account by default, change the  /etc/hotplug/usb/speedtch file accordingly:

#!/bin/bash

case $ACTION in

add)
    if /usr/sbin/modem_run -k -f /usr/lib/speedtouch/firmware.bin ; then
        sleep 5
        # /usr/sbin/pppd call speedtch
    fi
    ;;

esac



Thanks to Giacomo Magnini, Leonard den Ottolander and Laurent Vaills for their remarks.




Eric Brasseur  -  June 2 2004        [ Homepage | e-mail ]
 楼主| 发表于 2004-7-20 10:57:18 | 显示全部楼层

在这里忍不发泄一下,

mandrake不知怎么搞的,每个版本的设置都不一样,按它自带的工具总是不能成功,每次的错误还都不一样,太糟糕了
发表于 2004-8-23 23:12:15 | 显示全部楼层
我在suse下用这个设备没成功过,这个贴子我去照着做做看
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表