Linux PCMCIA/CardBus LAN-modem installation Guide CONTENTS 1. Introductions 2. Installing PCMCIA Card Services 2.1 Configuration for LAN cards 3. Use Modem in Redhat 5 3.1 netcfg/ifup/ifdown 3.2 xisp 3.3 kppp 4. Use Modem in Slackware 3.x 4.1 script base 4.2 xisp 4.3 kppp 1. Introductions This document briefly describes how to use the PCMCIA/CardBus LAN-modem in a Linux operating system and introduce several dial-up tools to use your PCMCIA modem either under X-windows or none. To use PCMCIA modem, you need to make sure the PPP has compiled into your Linux kernel for use of the modem dial-up. If your Linux kernel doesn't contain the PPP, please read the "README" file for the details of compiling kernel in the root directory of the Linux kernel source, generally in "/usr/src/linux", to recompile it again. And you also need to install the PCMCIA Card Services which responds to card insertion and removal events, loading and unloading drivers on demand. Chapter two discusses the installation of PCMCIA Card Services as well as the configuration of LAN cards. Chapter three and four describe several dial-up tools for specific Linux distributions. In these two chapters, the properities of ISP has assumed as: - No call back service - Dynamic IP allocation - Dialing mothed is tone - No manual login - Authentication protocol is PAP/CHAP. Any move to configure the environment of dial-up regarding callback service, static IP allocation, and manual login could be found in the dial-up tools' documents for the details. 2. Installing the PCMCIA Card Services Card Serives for Linux is written by David Hinds . It is now a part of many of the Linux distributions, like RedHat and Slackware. You need to install it into your Linux system for use of the PCMCIA or "PC Card". The source version is available at in the "/pub/pcmcia" dirctory, as "pcmcia-cs-x.tar.gz". Replace "x" with the version number of the latest package. To install the PCMCIA Card Services, you need to install a full kernel source and do the following shell commands: #tar zxvf pcmcia-cs-x.tar.gz #cd pcmcia-cs-x #./Configure #make all #make install Generally, you don't need to change any default selections when you run "./Configure" to configure the compiled environment. But if you want to use Card Bus adapter, enable the (CardBus) option. 2.1 Configuration for LAN cards For LAN card users, you need to use editor to edit the file "/etc/pcmcia/network.opts" to assign IP address, netmask, gateway IP, nameservers,broadcast address, and etc. after the Card Services installation. A part of the file "network.opts" is as listed which is mandatory setup for the TCP/IP of your Linux machine: #File: /etc/pcmcia/network.opts # # # #Host's IP address, netmask, network address, broadcast address IPADDR="1.2.3.4" NETMASK="255.255.255.0" NETWORK="1.2.3.0" BROADCAST="1.2.3.255" #Gateway address for static routing GATEWAY="1.2.3.254" #Things to add to /etc/resolv.conf for this interface DOMAIN="your.domain" SEARCH="" DNS_1="" DNS_2="" DNS_3="" # # Remember to reboot your Linux machine for the Card Services after installation. Now you should have the PCMCIA Card Services installed correctly. If the Card Service is not installed properly, please see the "PCMCIA-HOWTO" for the details in the root directory of the Card Services source code to resolve installation and configuraton problems. 3. RedHat 5 This section describes the useage of dial-up tools in the RedHat Linux, released by RedHat Software Inc, is currently most popular Linux distribution because of easy installation, and friendly user interface on system configuration. 3.1 "netcfg/ifup/ifdown" You can use the Redhat's configuration tool, named as "netcfg", to setup the dial-up environment in X-window to create a new modem device "PPP0". - Now bring up "netcfg" * Click "Names" option to set the Nameservers, the host name, and domain, if your Linux machine has not configured them yet. * Click "Interfaces" , and then depress "Add" to select "PPP" widget to add a new interface. Click "Ok" to save added device interface. * Double clicks on the new interface, like "ppp0", you made before to configure the properities of the "PPP interface". ** "Hardware" - Depress "Use hardware flow control and modem lines" and "Abort connection on well-known errors" widgets only. - Line Speed: modem's speed - Modem Port: "/dev/modem" ** "Communication" ** "Networking" Unchanged ** "PAP" - Enter "Username", and password in the "Secret" field if you need to use the password authentication. The username and password will be written out the file "/etc/ppp/pap-scerets". * Then, click "Done" to save your configuration. - Do a "ifup ppp0" in X-window' shell and wait for a mount to let modem dial-out, negotitate line speed, and check authentication. - You can check whether the dial-up is succeeded by using "ifconfig" to show the currently active network interfaces. If the dial-up is succeeded in connecting with the Ineternet, the "ppp0" interface should be shown as following: #ifconfig ppp0 Link encap:Point-to-Point Protocol inet addr:1.2.3.4 P-t-P:1.2.3.5 Mask:255.255.255.0 - Use "ifdown ppp0" to logout from your ISP when finished. 3.2 "xisp" Another dial-up tool is called "xisp". The "xisp" is a user-friendly interface to pppd/chat. 3.2.1 Installing "xisp" To use the "xisp", you need to have ppp-2.2.0f or newer properly installed on your system. The "xisp" dial-up tool is not coming with Redhat distribution, so you need to get a copy of "xisp-2.3p4-2.i386.rpm" and "xforms-0.88-6.i386.rpm" from the FTP sites. - Do shell commands #rpm -ihU xforms-0.88-6.i386.rpm #rpm -ihU xisp-2.3p4-2.i386.rpm to get them all put in place. You may replace aforementioned two files with the newer version. - Now you should have the "xisp" installed correctly. 3.2.2 Using "xisp" Initially, you need to setup the "Options" menu which contains "ISP Information", "Account Information", "Dialing and Login", "Communication Options", "TCP/IP Options", and "Paths Setup". Here is the procedures of setting an ISP entry. Click "Options" button to setup following fields: - "ISP Information" * Create a new ISP name by double-clicking on the "~" character. * Click the "Default ISP" check-button to let the selected ISP be as a default account. * Click the "Auto-dial up startup", if you want the xisp to dial the ISP upon it invoked. * Click "OK" returns to main program. - "Account Information" * Edit the following fields: "Phone no(s)" "Account Name" if it activiated "Password" if it activiated "User/Name" * The radio-button enables the use of password authentication via PAP CHAP PAP-S using "/etc/ppp/pap-secrets" file, CHAP-S using "/etc/ppp/chap-secrets" file. - "Dialling and Login" Unchaged - "Communication Options" Select "Baud Rate", "Hardware RTS/CTS" flow control" for your modem. -"TCP/IP Options" Unchanged. - The "xisp" will use and parse the "pap-secrets" or "chap-secrets" in the directory "/etc/ppp", depends on the authentication protocol you selected. So you need to use editor to edit these two files to add the "Account Name" and "Password", just like the format of the following: #File:/etc/ppp/pap-secrets #File:/etc/ppp/chap-secrets # # Username Server Password IP address #------------------------------------------------ "guest" * "password" * Note that these files should have a permission of 600. #chmod 600 /etc/ppp/pap-secrets (or /etc/ppp/chap-secrets) Now, you can click "CONNECT" to dial-up to the ISP and click "DISCONNECT" when finished. This section is only the part of descriptions of the xisp for the Internet connectivity. For the details of this tool, please see the xisp's "help". 3.3 "kppp" utility The "kppp" dial-up tool is part of the KDE(K Desktop Environment). All KDE applications use Troll Tech's Qt libraries, which provide an well-designed cross-platform API for graphical user inferace programming, so you must download all of the KDE packages and the Qt libraries. Now you can download and install the KDE packages in following order: ftp://ftp.kde.org/pub/kde/stable/1.1/distribution qt-1.42-3rh51.i386.rpm (Qt libraries) kdelibs-1.1-6rh5x.i386.rpm (KDE libraries) kdesupport-1.1-6rh5x.i386.rpm (Additional KDE support libraries) kdebase-1.1-6rh5x.i386.rpm (KDE base environment) kdenetwork-ppp-1.1-2rh5x.i386.rpm (KDE ppp network package) Use the powerful package manager "rpm" to do the following commands #rpm -ihU qt-1.42-3rh51.i386.rpm #rpm -ihU kdelibs-1.1-6rh5x.i386.rpm #rpm -ihU kdesupport-1.1-6rh5x.i386.rpm #rpm -ihU kdebase-1.1-6rh5x.i386.rpm #rpm -ihU kdenetwork-ppp-1.1-2rh5x.i386.rpm to install or upgrade KDE envrionment and "kppp". The KDE could be run by typing "xinit" and "startkde". 3.3.1 Using kppp There is a blank accounts information when you use the "kppp" at the first time. So you need to click "Setup" to enter the "kppp Configuration" dialog to configure: - "Accounts" Click "Edit" to setup "Connection Name", "Phone number" of your ISP, and type of password "Authenitication". * "IP" Depress the "Dynamic IP Address" widget. * "DNS" Enter the IP address of the domain name server, then press "Add" button. You can also enter the secondary DNS's IP address for use in case the primary server goes down. The addresses will be added at runtime to "/etc/resolv.conf". Do NOT depress the "Disable existing DNS Servers during connection" widget. * "Gateway" Depress "Assign the Deafult Route to this Gateway" and "Default Gateway" widgets. * "Login Script" Unchanged * "Accounting" Unchanged - "Device" Check following fields: Modem Device : "/dev/modem" Flow Control : "CRTSCTS" Line Termination : "CR/LF" Connection Speed : Select Modem's speed Do NOT depress "Use Lock File" widget. Keep the default value of "Modem Timeout". - "Modem" Only change the "Modem volume" as you need. - "PPP","Graph" Use these options as your favor. - "About" To see the authors Click "OK' to return the main panel. Now you can select a alias name of the list you made, enter the "Login ID" and "Password", and click "Connect". After a mount of negotiation and password authenthication, your Linux machine should have connected to the Internet if the "ppp0" interface could be found by using "ifconfig". #ifconfig ppp0 Link encap:Point-to-Point Protocol inet addr:1.2.3.4 P-t-P:1.2.3.5 Mask:255.255.255.0 4. Slackware Another popular Linux system is the Slackware, released by Walnut Creek CDROM, has also easer installation and setup. 4.1 script base This section describes the simple way to setup your pppd deamon to connect your Linux machine to your ISP either under X-window or none. The tool "pppsetup" should be found in your Linux system after installing the Slackware 3.5/6. If you don't have the "pppsetup", please go the FTP site to get the file "pppsetup-1.xx.tar.gz". Replace the "xx" with the newer version. 4.1.1 Using "pppsetup" - Type "pppsetup" The "pppsetup" will ask you some simple questions about ISP's phone number, modem port, baud rate, domain name, DNS, and password authentication. Finally, it write your answer to the files "options", "pap-secrets" (or chap-secrets. Depens on password authenication.), and "pppscript" in the directory "/etc/ppp". You can issue a command "ls -l /dev/modem" to make sure which modem device was mapped by the Card Services, such as "/dev/cua2" - Then, you can type "ppp-go" to dial-up to your ISP. - Now your Linux machine should already interconnect with your ISP. Using "ifconfig" could check whether the "ppp0" is added or not. #ifconfig ppp0 Link encap:Point-to-Point Protocol inet addr:1.2.3.4 P-t-P:1.2.3.5 Mask:255.255.255.0 - Type "ppp-off" could disconnet your Linux machine from ISP. 4.2 "xisp" utility Another dial-up tool is called "xisp". It is an user-friendly interface to pppd/chat deamon. 4.2.1 Installing xisp To use the "xisp", you need to have ppp-2.2.0f or newer properly installed on your system. The "xisp" dial-up utility is not coming with Slackware distribution, so you need to get a copy of "xforms-0.88.tgz" and "xisp-2.5p4.tar.gz" from FTP site. Before you could compile and install these packages, you need to make sure you have X11R6(XFree86-3.1.2 or newer) installed properly. In addition, a copy of the XForms GUI library, version 0.88 or newer, must be installed before compiling and installing the "xisp". 4.2.2 Using "xisp" Initially, you need to setup the item of the "Options" menu which contains "ISP Information", "Account Information", "Dialing and Login", "Communication Options", "TCP/IP Options", and "Paths Setup" because of blank ISP list. Here is the procedures of setting an ISP entry: Click "Options" button to setup following fields: - "Account Information" * Create a new ISP name by double-clicking on the "~" character or pressing "Add" button. * Click the "Default ISP" check-button to let the selected ISP be as a default account. * Click the "Auto-dial up startup", if you want the xisp to dial the ISP upon it invoked. * Edit the following fields: "Phone no(s)" "Account Name" "Password" "User/Name" * The radio-button enables the use of password authentication via PAP CHAP PAP-S using "/etc/ppp/pap-secrets" file, CHAP-S using "/etc/ppp/chap-secrets" file. * Click "OK" returns to main program. - "Dialing and Login" Unchaged. - "Communication Options" * Select "Serial Port Baud Rate", "Hardware RTS/CTS" flow control for your modem. * Click "OK" returns to main program. - "TCP/IP Options" - "Path Setup" Unchanged. - The "xisp" will use and parse the "pap-secrets" or "chap-secrets" in the directory "/etc/ppp", depends on the authentication protocol you selected. So you need to use editor to edit these two files to add the "Account Name" and "Password", just like the format of the following: #File:/etc/ppp/pap-secrets #File:/etc/ppp/chap-secrets # # Username Server Password IP address #------------------------------------------------ "guest" * "password" * Note that these files should have a permission of 600. #chmod 600 /etc/ppp/pap-secrets (or /etc/ppp/chap-secrets) Now, you can click "CONNECT" to dial up to the ISP and click "DISCONNECT" when finished. This section is only the part of descriptions of the xisp for the Internet connectivity. For the details of this tool, please see the xisp's "help". 4.3 "kppp" utility The "kppp" dialing tool is part of the KDE (K Desktop Environment). All KDE applications use Troll Tech's Qt libraries, which provide an well-designed cross-platform API for graphical user inferace programming, so you must download all of the KDE packages and the Qt libraries. 4.3.1 Downloading and installing "kppp" Now you can go to the FTP site ftp://ftp.kde.org /pub/kernel/kde/stable/1.1/distribution/tar/generic/source to download the KDE packages: kdelibs-1.1.tar.gz (KDE libraries) kdesupport-1.1.tar.gz (Additional KDE support libraries) kdebase-1.1.tar.gz (KDE base environment) kdenetwork-1.1.tar.gz (KDE network package) In addition, go to the FTP site ftp://ftp.troll.no/qt/source to download the Qt libraries qt-1.xx.tar.gz Replace "xx" with the newer version.Now you should unpack and compile to install following files in order: 1. qt-1.xx.tar.gz (Qt libraries) 2. kdelibs-1.1.tar.gz (KDE libraries) 3. kdesupport-1.1.tar.gz (Additional KDE support libraries) 4. kdebase-1.1.tar.gz (KDE base environment) 5. kdenetwork-1.1.tar.gz (KDE network package) Please see the "INSTALL" file for the instructions to install these packages in each source code directory. The KDE could be run by typing "xinit" and "startkde". 4.3.2 Using "kppp" There is a blank accounts information when you use the "kppp" at the first time. So you need to click "Setup" to enter the "kppp Configuration" dialog to configure: - "Accounts" Click "Edit" to setup "Connection Name", "Phone number" of your ISP, and type of password "Authentication". * "IP" Depress the "Dynamic IP Address" widget. * "DNS" Enter the IP address of the domain name server;then press "Add" button. You can also enter the secondary DNS's IP address for use in case the primary server goes down. The addresses will be added at runtime to "/etc/resolv.conf". Do NOT press the "Disable existing DNS Servers during connection" widget. * "Gateway" Depress "Assign the Deafult Route to this Gateway" and "Default Gateway" widgets. * "Login Script" * "Accounting" Unchanged - "Device" Check following fields: Modem Device : "/dev/modem" Flow Control : "CRTSCTS" Line Termination : "CR/LF" Connection Speed : Select Modem's speed Do NOT depress "Use Lock File" widget. Keep the default value of "Modem Timeout". - "Modem" Only change the "Modem volume" as you need. - "PPP","Graph" Use these options as your favor. - "About" To see the authors Click "OK' to return the main panel. Now you can select a alias name of the list you made, enter the "Login ID" and "Password", and click "Connect". After a mount of negotiation and password authenthication, your Linux machine should be connected to the Internet if the "ppp0" interface could be found by using "ifconfig". #ifconfig ppp0 Link encap:Point-to-Point Protocol inet addr:1.2.3.4 P-t-P:1.2.3.5 Mask:255.255.255.0